mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-25 06:15:37 +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. */
|
/* If visible = 1, entity will be set to be visible, else invisible. */
|
||||||
stock set_entity_visibility(entity, visible = 1) {
|
stock set_entity_visibility(entity, visible = 1) {
|
||||||
new effects = entity_get_int(entity, EV_INT_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)
|
||||||
if (visible == 1)
|
|
||||||
effects &= ~EF_NODRAW
|
|
||||||
else
|
|
||||||
effects |= EF_NODRAW
|
|
||||||
|
|
||||||
entity_set_int(entity, EV_INT_effects, effects)
|
|
||||||
|
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user