Raised This Month: $32 Target: $400
 8% 

Help me with this code


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alicx
BANNED
Join Date: Mar 2013
Location: Tunisia
Old 05-14-2013 , 07:27   Help me with this code
Reply With Quote #1

hello everyone , i have maked this code to contorle the ammo of this weapon by cvar but no result
when i do this: i have unlimeted ammo
Code:
public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     /////other cvars     cvar_bullets = register_cvar("m4_bullets", "150") } ////////Others codes//////// new money = cs_get_user_money(id) if (money >= get_pcvar_num(cvar_cost) && get_pcvar_num(cvar_bullets))     {         cs_set_user_money(id, money - get_pcvar_num(cvar_cost))         give_item(id, "weapon_m4a1")         give_item(id, "ammo_556nato")         cs_set_user_bpammo(id, CSW_M4A1, (cvar_bullets))         g_HasM4[id] = true     }

but when i do this: i have 150 ammmo
Code:
////////Others codes//////// if (money >= get_pcvar_num(cvar_cost))     {         cs_set_user_money(id, money - get_pcvar_num(cvar_cost))         give_item(id, "weapon_m4a1")         give_item(id, "ammo_556nato")         cs_set_user_bpammo(id, CSW_M4A1, 150)         g_HasM4[id] = true     }

why the cavr don't work ??
alicx is offline
Send a message via MSN to alicx Send a message via Skype™ to alicx
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 05-14-2013 , 07:47   Re: Help me with this code
Reply With Quote #2

cs_set_user_bpammo(id, CSW_M4A1, (cvar_bullets))

=>

cs_set_user_bpammo(id, CSW_M4A1, get_pcvar_num(cvar_bullets))

or

new AMMO = get_pcvar_num( cvar_bullets );
cs_set_user_bpammo(id, CSW_M4A1, AMMO )
__________________

Last edited by Blizzard_87; 05-14-2013 at 07:48.
Blizzard_87 is offline
alicx
BANNED
Join Date: Mar 2013
Location: Tunisia
Old 05-14-2013 , 08:27   Re: Help me with this code
Reply With Quote #3

Quote:
Originally Posted by Blizzard_87 View Post
cs_set_user_bpammo(id, CSW_M4A1, (cvar_bullets))

=>

cs_set_user_bpammo(id, CSW_M4A1, get_pcvar_num(cvar_bullets))

or

new AMMO = get_pcvar_num( cvar_bullets );
cs_set_user_bpammo(id, CSW_M4A1, AMMO )
thanks a lot :
alicx is offline
Send a message via MSN to alicx Send a message via Skype™ to alicx
Reply


Thread Tools
Display Modes

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 06:07.


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