Raised This Month: $ Target: $400
 0% 

Weapon ammo HELP


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 05-19-2010 , 15:30   Re: Weapon ammo HELP
Reply With Quote #10

Quote:
Originally Posted by ConnorMcLeod View Post
You are wrong.
You need to create a variable, and check if it's not null before you send cs_set_weapon_ammo.

Code:
new wpn = give_item(id, "weapon_scout") if( wpn > 0 ) {  cs_set_weapon_ammo(wpn, 0) } cs_set_user_bpammo(id, CSW_SCOUT,  0)
How would it return as null? I've never had a run-time error in my plugins where I use the method demonstrated above. The only circumstances under which I see this happening is if the player isn't connected/valid or if there's some Item_CanDeploy issues. Chances are, he'll be using the connected check in that function somewhere, so he won't have to worry about that.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ 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 03:34.


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