Raised This Month: $ Target: $400
 0% 

Special Round -Knife Round


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
LearninG
Senior Member
Join Date: Apr 2019
Location: Iran
Old 09-06-2019 , 10:00   Re: Special Round -Knife Round
Reply With Quote #4

cvar :
Quote:
knife_round_delay "15"
main plugin :
Code:
/* Knife Round =========== Description After every X rounds , an special knife round will be occur. */ #include <amxmodx> #include <fun> #include <engine> new const HUD_COLOR[3] = {0 , 255 , 0} const Float: HUD_POSITION_X = -1.0 const Float: HUD_POSITION_Y = 0.25 const HOLD_TIME = 5 new const g_szBuyCmds[ ][ ] = {     "usp", "glock", "deagle", "p228", "elites", "fn57", "m3", "xm1014", "mp5", "tmp", "p90", "mac10", "ump45", "ak47",     "galil", "famas", "sg552", "m4a1", "aug", "scout", "awp", "g3sg1", "sg550", "m249", "vest", "vesthelm", "flash", "hegren",     "sgren", "defuser", "nvgs", "shield", "primammo", "secammo", "km45", "9x19mm", "nighthawk", "228compact", "12gauge",     "autoshotgun", "smg", "mp", "c90", "cv47", "defender", "clarion", "krieg552", "bullpup", "magnum", "d3au1", "krieg550",     "buyammo1", "buyammo2" } new const VERSION[] = "1.0" new const PLAYER_CLASS[] = "player" new g_knife_round new bool: g_is_knife_round new cvar_knife_round public plugin_init() {     register_plugin("Knife Round" , VERSION , "LearninG")     for (new i; i<sizeof g_szBuyCmds; i++)     {         register_clcmd(g_szBuyCmds[i] , "block_buy")     }     register_touch("armoury_entity", PLAYER_CLASS, "PlayerTouchArmoury")     register_touch("weaponbox", PLAYER_CLASS, "PlayerTouchWeaponBox")     register_touch("weapon_shield", PLAYER_CLASS, "PlayerTouchShield")     register_logevent("event_new_round",2,"0=World triggered","1=Round_Start")     register_cvar("knife_round_version", VERSION, FCVAR_SERVER | FCVAR_SPONLY)     cvar_knife_round = register_cvar("knife_round_delay" , "15") } public event_new_round() {     g_is_knife_round = false     g_knife_round++     if (g_knife_round == get_pcvar_num(cvar_knife_round))     {         g_is_knife_round = true         g_knife_round = 0         new players[32], num         get_players(players, num, "ach")         for( --num; num >= 0; num-- )         {             strip_user_weapons(players[num])             give_item(players[num] , "weapon_knife")             set_hudmessage(HUD_COLOR[0] , HUD_COLOR[1] , HUD_COLOR[2] , HUD_POSITION_X , HUD_POSITION_Y , 0, 8.0, 6.0, 0.3, 0.3, HOLD_TIME)             show_hudmessage(players[num] , "Knife Round!!!")         }     } } public block_buy() {     if (g_is_knife_round)     {         return PLUGIN_HANDLED     }     return PLUGIN_CONTINUE } public PlayerTouchArmoury(ent, id) {     if (g_is_knife_round)     {         return PLUGIN_HANDLED     }     return PLUGIN_CONTINUE } public PlayerTouchWeaponBox(ent, id) {     if (g_is_knife_round)     {         return PLUGIN_HANDLED     }     return PLUGIN_CONTINUE } public PlayerTouchShield(ent, id) {     if (g_is_knife_round)     {         return PLUGIN_HANDLED     }     return PLUGIN_CONTINUE }
let me know if any bug occurres.
LearninG is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:49.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode