Quote:
Originally Posted by NoroHime
thanks report, looks some grenade_launcher_projectile didnt have owner, anyway double check it
|
You still have to check if entity is valid in SDKHook_SpawnPost.
PHP Code:
SDKHook(entity, SDKHook_SpawnPost, OnProjectileCreated);
void OnProjectileCreated(int entity) {
if ( entity <= MaxClients || !IsValidEntity(entity) ) return;
...
}
Better use EntIndexToEntRef if using RequestFrame, entity could be removed or invalid on next frame.
PHP Code:
RequestFrame(ReplaceProjectileVVel, EntIndexToEntRef(entity));
void ReplaceProjectileVVel(int entity)
{
if( (entity = EntRefToEntIndex(entity)) != INVALID_ENT_REFERENCE )
{
.....
}
}
__________________