Quote:
[CSTRIKE] Non-player entity 0 out of range
[AMXX] Run time error 10: native error (native "cs_set_weapon_ammo")
[AMXX] [0] gn_retake.sma::playerSpawned (line 127)
|
Code:
public playerSpawned(id)
{
if (cs_get_user_team(id) == CS_TEAM_T)
{
cs_set_weapon_ammo(find_ent_by_owner(-1,"weapon_ak47",id),30)
cs_set_weapon_ammo(find_ent_by_owner(-1,"weapon_glock18",id),20)
cs_set_weapon_ammo(find_ent_by_owner(-1,"weapon_usp",id),12)
}
}
This function does what I want it to do but I get this error and I would like to know why.
I'm not sure if the weapon entity index is set incorrectly or if the issue is that noone has a specific weapon.
Thanks!
__________________