Raised This Month: $ Target: $400
 0% 

get_cvar_num problems


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
shino
Senior Member
Join Date: May 2006
Old 06-07-2006 , 16:34  
Reply With Quote #4

still, if i type amx_instagibweapon, i get ak47. it depends on the first weapon i would like to give: if it is
Code:
if(equali(weap , "ak47")) {   give_item(id , "weapon_ak47");   cs_set_user_bpammo(id , CSW_AK47 , 90);   return PLUGIN_HANDLED; }
, amx_instagibweapon is ak47, if it is:
Code:
if(equali(weap , "usp")) {   give_item(id , "weapon_usp");   cs_set_user_bpammo(id , CSW_USP , 90);   return PLUGIN_HANDLED; }
, amx_instagibweapon is usp.

also, i made the code look like this now:
Code:
public GiveWeapon(id) {     if( get_cvar_num( "amx_instagib" ) != 1 ) {         return PLUGIN_HANDLED     }     new players[32],num,i,id,cvar,ak47,usp     get_players(players,num)     for(i = 0; i <= num; i++) {         id = players[i]         if(is_user_alive(id)) {             new weap[21]             get_cvar_string("amx_instagibweapon" , weap , 20)             if(equali(weap , "usp"))                 {                 give_item(id , "weapon_usp")                 cs_set_user_bpammo(id , CSW_USP, 90)                 return PLUGIN_HANDLED             }                       if(equali(weap , "ak47"))                 {                 give_item(id , "weapon_ak47")                 cs_set_user_bpammo(id , CSW_AK47 , 90)                 return PLUGIN_HANDLED             }                   }     }     return PLUGIN_CONTINUE }
server crashes.
EDIT: there's no problem, my mistake!
shino 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 16:31.


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