Quote:
Originally Posted by Natsheh
Show the code.
|
PHP Code:
public SetModel(entity, model[])
{
if(!pev_valid(entity))
return FMRES_IGNORED;
static Classname[32]; pev(entity, pev_classname, Classname, sizeof(Classname));
if(!equal(Classname, "weaponbox"))
return FMRES_IGNORED;
static iOwner; iOwner = pev(entity, pev_owner);
static iWeapon; iWeapon = get_user_weapon(iOwner, _, _);
static weapon; weapon = find_ent_by_owner(-1, nWeapon[iWeapon], entity);
if(g_bUsingGuns[iOwner][iWeapon] && !pev(weapon, pev_impulse))
{
if(!pev_valid(weapon))
return FMRES_IGNORED;
set_pev(weapon, pev_impulse, g_bUsingGuns[iOwner][iWeapon]);
if(iWeapon == 28) {
entity_set_model(entity, wak47);
return FMRES_SUPERCEDE;
}
return FMRES_IGNORED;
}
return FMRES_IGNORED;
}
I tested with client_print, it's being called only once (when u first time drop item after pick/buy etc.)