Well, I saw on ZP when doing things with pdata offsets.
It checks befores if entity is safe with pev_valid native.
For example:
Entity always be a player and if he receives damage should be valid ent...
Why is the reason to check this?
Is needed nowadays?
Where is needed to check pev_valid entity?
It checks befores if entity is safe with pev_valid native.
For example:
Код:
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage_Post", 1)
public fw_TakeDamage_Post(victim)
{
// Prevent server crash if entity's private data not initalized
if (pev_valid(victim) != 2) return;
set_pdata_float(victim, OFFSET_PAINSHOCK, 1.0, OFFSET_LINUX)
}
Entity always be a player and if he receives damage should be valid ent...
Why is the reason to check this?
Is needed nowadays?
Where is needed to check pev_valid entity?
Последнее редактирование: