mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-24 13:55:36 +03:00
Updated set_entity_visibility
This commit is contained in:
parent
e47104aa29
commit
431bfbb4d9
@ -195,13 +195,7 @@ stock set_entity_flags(ent,flag,onoff)
|
||||
|
||||
/* If visible = 1, entity will be set to be visible, else invisible. */
|
||||
stock set_entity_visibility(entity, visible = 1) {
|
||||
new effects = entity_get_int(entity, EV_INT_effects)
|
||||
if (visible == 1)
|
||||
effects &= ~EF_NODRAW
|
||||
else
|
||||
effects |= EF_NODRAW
|
||||
|
||||
entity_set_int(entity, EV_INT_effects, effects)
|
||||
entity_set_int(entity, EV_INT_effects, visible == 1 ? entity_get_int(entity, EV_INT_effects) & ~EF_NODRAW : entity_get_int(entity, EV_INT_effects) | EF_NODRAW)
|
||||
|
||||
return 1
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user