I'm having trouble with setting nodraw effect
PHP Code:
public HAM_Armoury_Touch_Pre(iArmoury, idUser) // The function is called when user touches Armoury entity
{
if(is_user_alive(idUser) // User should be alive
&& is_valid_ent(iArmoury) // The entity should be valid,
&& engfunc(EngFunc_EntIsOnFloor, iArmoury) // lying on the ground
&& !(entity_get_int(iArmoury, EV_INT_effects) & EF_NODRAW)) // and it shouldn't be picked up already
{
new iWeapon = cs_get_armoury_type(iArmoury) // Get the Weapon CSW_ id
give_user_weapon(idUser, iWeapon) // give the weapon (my func)
entity_set_int(iArmoury, EV_INT_effects, EF_NODRAW); // Make it disappear until next round
say("Trace") // Let's see if we got here
}
}
Using this code I pick up weapon with trace message. The armour entity disappears. Then I can throw the weapon away and pick up the original "invisible" weapon again normally, without trace message.
So how do I make it disappear until next round properly?