Raised This Month: $ Target: $400
 0% 

Won't add


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DoviuX
Senior Member
Join Date: Jun 2009
Location: Lithuania
Old 10-26-2009 , 16:57   Won't add
Reply With Quote #1

EveryThing compiles but gives 254 ammo.

In Sma :

PHP Code:
new M4A1AMMO
new AK47AMMO
new AWPAMMO
new DEAGLEAMMO

    M4A1AMMO 
register_cvar("rm_m4a1""150" )
    
AK47AMMO register_cvar("rm_ak47""150" )
    
AWPAMMO register_cvar("rm_awp""60" )
    
DEAGLEAMMO register_cvar("rm_deagle""100" )


public 
plugin_cfg()
{
    
// Get configs dir
    
new cfgdir32 ]
    
get_configsdircfgdircharsmaxcfgdir ) )

    
// Execute config file (haha.cfg)
    
server_cmd"exec %s/haha.cfg"cfgdir )
}

        
cs_set_user_bpammoidCSW_M4A1M4A1AMMO )
        
cs_set_user_bpammoidCSW_AK47AK47AMMO )
        
cs_set_user_bpammoidCSW_AWPAWPAMMO )
        
cs_set_user_bpammoidCSW_DEAGLEDEAGLEAMMO 
In Cfg:

Code:
rm_m4a1	"150"
rm_ak47		"150"		
rm_awp		"60"		
rm_deagle	"100"
DoviuX is offline
Send a message via Skype™ to DoviuX
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 10-26-2009 , 17:04   Re: Won't add
Reply With Quote #2

register_cvar returns a pointer to the cvar, not the value of the cvar.

You want to use the native get_pcvar_num with the corresponding cvar pointer.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Old 10-27-2009, 09:38
<VeCo>
This message has been deleted by <VeCo>.
Reply



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 17:37.


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