Plugin Grenade_control

All the news of the project/Все новости проекта
Аватар пользователя

Автор темы
Dame-DaNNers
Администраторы
Администраторы
Сообщений: 120
Зарегистрирован: 22 янв 2015, 15:31
STEAM_ID:
Благодарил (а): 32 раза
Поблагодарили: 16 раза
Контактная информация:

Plugin Grenade_control

Сообщение Dame-DaNNers » 26 фев 2017, 14:18

Про просьбе игроков на серверах №1, №2 был установлен плагин Grenade_control
Плагин запрещает покупать более (X) количество гранат за один раунд.
При попытке купить более 2 гранат любого типа игрок получи предупреждение, после повторной попытке
игрок получит наказание, затем игрок будет убит.
Изображение
Изображение

Аватар пользователя

Maluginensis
Главные модераторы
Главные модераторы
Сообщений: 2
Зарегистрирован: 14 фев 2017, 18:44
STEAM_ID:

Re: Plugin Grenade_control

Сообщение Maluginensis » 15 мар 2017, 09:50

Настройки в файле addons/amxx/configs/ "grenade_control.cfg"
mp_grencontrol // enable/disable plugin
mp_grencontrol_maxfb // number of FB's allowed per round
mp_grencontrol_maxhe // number of HE's allowed per round
mp_grencontrol_maxsg // number of SG's allowed per round
mp_grencontrol_warn // number of warnings before punishment
mp_grencontrol_damage // Slap them for x damage after max warnings

mp_grencontrol <1|0> -- 1) Плагин ВКЛ; 2) Плагин ВЫКЛ
mp_grencontrol_maxfb <значение> -- Слколько слеп за раунд
mp_grencontrol_maxhe <значение> -- Сколько грен за раунд
mp_grencontrol_maxsg <значение> -- сколько смоук за раунд
mp_grencontrol_warn <значение> -- Сколько предупреждений перед наказанием
mp_grencontrol_damage <значение> -- На сколько HP слепать при игнорировании предупреждений

Источник: https://forums.alliedmods.net/showthread.php?t=868

Аватар пользователя

Автор темы
Dame-DaNNers
Администраторы
Администраторы
Сообщений: 120
Зарегистрирован: 22 янв 2015, 15:31
STEAM_ID:
Благодарил (а): 32 раза
Поблагодарили: 16 раза
Контактная информация:

Re: Plugin Grenade_control

Сообщение Dame-DaNNers » 15 мар 2017, 15:50

Grenade Spam Punish есть похожий плагин, но данный плагин не тестировался.

Код: Выбрать все

 /*Grenade Spam Punish
*
* by [gOf]-Soul  from http://www.gofclan.org
*
* This is a very simple plugin I wrote to control grenade spamming.
* There were a couple different plugins out that would seem to control
* grenade spamming.  But they blocked if you would try to buy extra
* grenades.  The ones I tried only blocked you from buying them via
* the regular menu.  This plugin keeps you from throwing more grenades
* than the allotted number of grenades allowed by the configuration file

* The plugin requires that you use the engine module of amxmodx because
* I remove any grenades from the environment that should NOT have been
* thrown.  If you do not want to enable the engine module you can remove
* the requirement by removing the remove_entity(greindex) line at the
* bottom of the script.
*
* Config Flags
* -----------------------------------------------------------------------------
* cvar       : mp_grenspampunish
* description: cvar that determins if the grenade spam punish plugin is 
*              enabled possible values are 1 and 0.  To enable the plugin 
*              set it to 1 to disable the plugin just set it to 0.
* default    : 1 (enabled)
*
* cvar       : mp_grenspampunish_maxflash
* description: Maximum number of flash bangs allowed to be thrown per round
* default    : 2
*
* cvar       : mp_grenspampunish_maxhe
* description: Maximum number of he grenades allowed to be thrown per round
* default    : 1
*
* cvar       : mp_grenspampunish_maxsmoke
* description: Maximum number of smoke grenades allowed to be thrown per round
* default    : 1
*
* cvar       : mp_grenspampunish_damage
* description: Amount of damage to inflict if someone violates the spam plugin
*              Damage of 100 will automatically kill them.  The plugin uses the
*              user_slap to inflict the damage
* default    : 100
*
*
* To load settings for a certain map then place them into the map specific
* config files i.e. amxmodx/configs/maps/de_dust.cfg
*
* -----------------------------------------------------------------------------

*  **************
*  * CHANGE LOG *
*  **************
*  v1.4
*   -Changed Array Declaration to get rid of out of bound error for 
*    the grencount array
*
*  v1.3
*   -Took out cstrike reference
*   -Code cleanup (thanks to vittu)
*
*  v1.2
*   -Removed the config file.  Place configuration directly into amxx.cfg
*   -For map specific configs use the map specific config features provided
*    by AmxModx
*   -Updated for pcvars - requires 1.70 and higher to use
*   -Updated to more dependable register_logevent("funcNewRound", 2, "1=Round_Start")
*    instead of ResetHud event
*   -Fixed bug of not clearing number of throws when a person joins the server
*    caused someone to get punished on first throw
*  
*  v1.1
*   -Updated the plugin to not write the grenade count information
*    to the vault.  Just used a global variable
*
*   -Added map specific grenade counts so that you could specify higher
*    grenade throw limits for certain maps like fy_pool_day
*
*/


#include <amxmodx>
#include <amxmisc>
#include <engine>

#define PLUGIN "Grenade Spam Punish"
#define VERSION "1.4"
#define AUTHOR "[gOf]-Soul"

new grencount[33][3]
//new currentMap[64]

new p_grenspampunish
new p_grenspampunish_maxflash
new p_grenspampunish_maxhe
new p_grenspampunish_maxsmoke
new p_grenspampunish_damage

public plugin_init(){
  
register_plugin(PLUGIN  VERSION AUTHOR )
  
  
register_logevent("funcNewRound"2"1=Round_Start")

  
p_grenspampunish=register_cvar("mp_grenspampunish","1"// enable/disable plugin
  
p_grenspampunish_maxflash=register_cvar("mp_grenspampunish_maxflash","2"// number of FB's allowed per round
  
p_grenspampunish_maxhe=register_cvar("mp_grenspampunish_maxhe","1"// number of HE's allowed per round
  
p_grenspampunish_maxsmoke register_cvar("mp_grenspampunish_maxsmoke","1"// number of SG's allowed per round
  
p_grenspampunish_damage register_cvar("mp_grenspampunish_damage","100"// health to remove upon punishment

  //new configsdir[128]
  //get_configsdir(configsdir, 127)
  //server_cmd("exec %s/amxx.cfg", configsdir)
  
  //new currmap[128]
  //get_mapname(currmap,127)
  //server_cmd("exec %s/maps/%s.cfg",configsdir, currmap)
  
  
return PLUGIN_CONTINUE 
}

public 
client_putinserver(id){
  
//reset he grenades count
  
grencount[id][0] = 0

  
//reset smoke grenades count
  
grencount[id][1] = 0

  
//reset flash grenades count
  
grencount[id][2] = 0
}

public 
funcNewRound() {
    if ( !
get_pcvar_num(p_grenspampunish) )
        return 
PLUGIN_CONTINUE

    
new players[32], numPlayerCountidxPlayer
    get_players
(playersnumPlayerCount)
    for(
idxPlayer 0idxPlayer numPlayerCountidxPlayer++)
    {
        
        
//reset he grenades count
        
grencount[players[idxPlayer]][0] = 0

        
//reset smoke grenades count
        
grencount[players[idxPlayer]][1] = 0
        
        
//reset flash grenades count
        
grencount[players[idxPlayer]][2] = 0

    


    return 
PLUGIN_CONTINUE
}

public 
grenade_throwindex greindex wId ){
    if ( !
get_pcvar_num(p_grenspampunish) )
        return 
PLUGIN_CONTINUE
    
    
new punishlevel,grencountindex
    
new playername[32],greName[32]
    
get_user_name(indexplayername32)

    
//Example of a switch statement
    
switch (wId)
    {
        case 
CSW_HEGRENADE:
        {
            
copy(greName,31,"HE Grenades")
            
punishlevel get_pcvar_num(p_grenspampunish_maxhe)
            
grencountindex 0
        
}
        case 
CSW_SMOKEGRENADE:
        {
            
copy(greName,31,"Smoke Grenades")
            
punishlevel get_pcvar_num(p_grenspampunish_maxsmoke)
            
grencountindex 1
        
}
        case 
CSW_FLASHBANG:
        {
            
copy(greName,31,"Flash Grenades")
            
punishlevel get_pcvar_num(p_grenspampunish_maxflash)
            
grencountindex 2
        
}
    }
  
    
grencount[index][grencountindex]=grencount[index][grencountindex]+1

    
if (punishlevel grencount[index][grencountindex]){
        
client_print(index ,print_chat,"You have exceeded the maximum number of %s that you can throw.",greName)
        
client_print(index ,print_chat,"You are only allowed %d %s per round.",punishlevel,greName)
    
        
user_slap(indexget_pcvar_num(p_grenspampunish_damage))
    
        
remove_entity(greindex)
        
//set_hudmessage (r, g, b, x, y, effects, fxtime, holdtime, fadeintime, fadeouttime, channel=4 )
        
set_hudmessage(255 ,,,-1.0 ,0.32 ,,6.0 ,10.0,1.0,1.0,)
        
show_hudmessage(0,"%s was punished because they were grenade spamming"playername)
    }
    return 
PLUGIN_CONTINUE
}
 

Источник: https://forums.alliedmods.net/showthread.php?t=23057


Вернуться в «News/Новости»

Кто сейчас на форуме

Количество пользователей, которые сейчас просматривают этот форум: нет зарегистрированных пользователей и 13 гостей