Quote:
Originally Posted by CrazY.
Honestly I have not seen anything informing to ignore this error on the site that Bugsy given to you...
|
Well, I am far from a programmer and just starting out.
My plugin works without any issues, and I simply thought that it would return 0 if it didnt find any weapon entity.
There was not much further explanation, I still don't know how to properly check if an entity exists..
Something like this?
PHP Code:
new ak47Ent;
new glock18Ent;
new uspEnt;
ak47Ent = find_ent_by_owner(-1, "weapon_ak47", id);
glock18Ent = find_ent_by_owner(-1, "weapon_glock18", id);
uspEnt = find_ent_by_owner(-1, "weapon_usp", id);
if(pev_valid(ak47Ent))
{
cs_set_weapon_ammo(find_ent_by_owner(-1,"weapon_ak47",id),30)
}
if(pev_valid(glock18Ent))
{
cs_set_weapon_ammo(find_ent_by_owner(-1,"weapon_glock18",id),20)
}
if(pev_valid(uspEnt))
{
cs_set_weapon_ammo(find_ent_by_owner(-1,"weapon_usp",id),12)
}
__________________