ограничение покупки гранат, ограничение |
Здравствуйте, гость Вход | Регистрация
Наши новости:
|
| ! | В разделе запрещено создавать темы связанные с раскруткой игровых серверов |
|
|
ограничение покупки гранат, ограничение |
csparena
|
8.11.2017, 19:13
Сообщение
|
![]() |
Добрый вечер .. ребят нужна помощь .. есть ли такой плагин чтоб ограничить закуп грен .
а то это полный бред, прям не выйдешь с респы |
|
|
|
csparena
|
8.11.2017, 19:24
Сообщение
|
![]() |
spasibo тебе.. но честно говоря я ничего не понял
|
|
|
|
Izmayl7
|
8.11.2017, 19:29
Сообщение
|
|
|
spasibo тебе.. но честно говоря я ничего не понял Запрет покупки более 1-й гранаты "HE" за один раунд Запрет покупки более 1-й гранаты "HE" за один раунд Код /*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], numPlayerCount, idxPlayer get_players(players, numPlayerCount) for(idxPlayer = 0; idxPlayer < numPlayerCount; idxPlayer++) { //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_throw( index , greindex , wId ){ if ( !get_pcvar_num(p_grenspampunish) ) return PLUGIN_CONTINUE new punishlevel,grencountindex new playername[32],greName[32] get_user_name(index, playername, 32) //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(index, get_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 ,0 ,0 ,-1.0 ,0.32 ,0 ,6.0 ,10.0,1.0,1.0,4 ) show_hudmessage(0,"%s was punished because they were grenade spamming", playername) } return PLUGIN_CONTINUE }
Отредактировал: Izmayl7, - 8.11.2017, 19:30
|
|
|
|
csparena
|
8.11.2017, 19:39
Сообщение
|
![]() |
не компилируется плагин
|
|
|
|
Izmayl7
|
8.11.2017, 19:50
Сообщение
|
|
|
|
Поблагодарили 1 раз
|
|
csparena
|
8.11.2017, 19:54
Сообщение
|
![]() |
|
|
|
|
Izmayl7
|
8.11.2017, 20:04
Сообщение
|
|
|
|
Поблагодарили 1 раз
|
|
csparena
|
8.11.2017, 20:27
Сообщение
|
![]() |
не работает.. как сразу покупают и лимит срабатывается
серв падает |
|
|
|
Izmayl7
|
8.11.2017, 20:30
Сообщение
|
|
|
|
|
|
|
csparena
|
8.11.2017, 20:31
Сообщение
|
![]() |
да ребят подскажите пожалуйста
|
|
|
|
![]() ![]() |