Quote:
Originally Posted by ConnorMcLeod
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.
__________________