L 08/11/2013 - 20:29

2: [CSTRIKE] Non-player entity -1 out of range
L 08/11/2013 - 20:29

2: [AMXX] Displaying debug trace (plugin test.amxx")
L 08/11/2013 - 20:29

2: [AMXX] Run time error 10: native error (native "cs_set_weapon_ammo")
L 08/11/2013 - 20:29

2: [AMXX] [0] test.sma::knife (line 251)
This is error i get
This is the function:
PHP Code:
public knife(id)
{
if(is_user_alive(id)) {
new clip, ammo;
new usersweapon = get_user_weapon ( id, clip, ammo );
if ( usersweapon == CSW_C4 ) {
new cclip, aammo
get_user_ammo(id, CSW_DEAGLE, cclip, aammo)
if(is_user_alive(id)) {
strip_user_weapons(id)
give_item(id,"weapon_knife")
cs_set_weapon_ammo(give_item(id, "weapon_deagle"), cclip)
}
}
}
}
Activated by this:
PHP Code:
register_event ( "CurWeapon", "knife", "b" );
And line 251 is this:
PHP Code:
cs_set_weapon_ammo(give_item(id, "weapon_deagle"), cclip)
It just fills up my error log file. How can I fix it?