Raised This Month: $ Target: $400
 0% 

get_cvar_num problems


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
shino
Senior Member
Join Date: May 2006
Old 06-07-2006 , 15:36   get_cvar_num problems
Reply With Quote #1

Code:
public plugin_init() {     register_cvar( "amx_instagibweapon", "xm1014" )     register_logevent("round_start",2,"0=World triggered","1=Round_Start") } public round_start(id) {     set_task(0.1,"GiveWeapon") } public GiveWeapon(id) {     if( get_cvar_num( "amx_instagib" ) != 1 ) {         return PLUGIN_HANDLED     }     new players[32],num,i,id,cvar,ak47,xm1014     get_players(players,num)     for(i = 0; i <= num; i++) {         id = players[i]         if(is_user_connected(id) && is_user_alive(id)) {             cvar = get_cvar_string("amx_instagibweapon",players,31)             cs_set_user_money(id,1)             strip_user_weapons(id)             give_item(id,"weapon_knife")             if(cvar == ak47) {                 give_item(id,"weapon_ak47")                 give_item(id,"weapon_ak47")                 give_item(id,"weapon_ak47")                 give_item(id,"weapon_ak47")             }             if(cvar == xm1014) {                 give_item(id,"weapon_xm1014")                 give_item(id,"weapon_xm1014")                 give_item(id,"weapon_xm1014")                 give_item(id,"weapon_xm1014")             }         }     }     return PLUGIN_CONTINUE }
so, i would like the plugin to give me only xm1014, but i get ak47 also. even more, if i type amx_instagibweapon into console, it returns me that amx_instagibweapon is ak47, not xm1014.

i think the problem is in the cvar, so i would be very happy, if someone could help me on this one.
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