AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   knife mode doesnt work (https://forums.alliedmods.net/showthread.php?t=51656)

Crusher918 02-21-2007 22:15

knife mode doesnt work
 
hi I just moved my thread because i think i posted in the wrong section but i'm having problem with the script

here's the old thread:

http://forums.alliedmods.net/showthread.php?t=51655

XxAvalanchexX 02-21-2007 23:47

Re: knife mode doesnt work
 
Try this.

Code:
 #include <amxmod>  #include <amxmisc>  new bool:KnifeEnabled = false;  public amx_enableknife(id,level,cid)  {     if(!cmd_access(id,level,cid,2))         return PLUGIN_HANDLED;     new arg1[4];     read_argv(1,arg1,3);     if(equal(arg1,"1") || equali(arg1,"on"))         KnifeEnabled = true     else if(equal(arg1,"0") || equali(arg1,"off"))         KnifeEnabled = false     else     {         console_print(id,"Knives Only Mode is %s",KnifeEnabled ? "enabled" : "disabled");         return PLUGIN_HANDLED;     }     console_print(id,"Knives Only Mode %s",KnifeEnabled ? "enabled" : "disabled");     client_print(0,print_center,"Knives Only Mode Has Been %s!",KnifeEnabled ? "Enabled" : "Disabled");     engclient_cmd(0,"weapon_knife");     set_hudmessage(0, 100, 0, 0.05, 0.65, 2, 0.02, 10.0, 0.01, 0.1, 2);     show_hudmessage(0,KnifeEnabled ? "Seulement les coutos sont autorises !" : "Toutes les armes sont autorisees !");     return PLUGIN_HANDLED;  }  public switchweapon(id)  {     if(KnifeEnabled) engclient_cmd(id,"weapon_knife")  }  public plugin_init()  {     register_plugin("Knife Arena","0.9","tcquest78");     register_event("CurWeapon","switchweapon","be","1=1","2!29");     register_concmd("amx_knives","amx_enableknife",ADMIN_LEVEL_B,"<1|0> - knives only mode");  }


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

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