Thread
:
[TUT] SourcePawn Scripting - Tips, Basics to Advanced
View Single Post
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
03-16-2022 , 06:36 Re: [TUT] SourcePawn Scripting - Tips, Basics to Advanced
#
59
Follow this events order as example:
OnEntityCreated -> PostSpawn -> RequestFrame -> CreateTimer(timerReadEnt) -> EntityDestroyed > timerReadEnt
in timerReadEnt you will get an exception if you use the entity index cause it's gone (or replaced by another entity with the same index).
Storing the entity as EntRef allow you to post-check if that entityRef has an INVALID_REFERENCE (with EntRefToEntIndex) before using it.
The logic is the same as what happens to the player. (GetClientUserId)
__________________
My Plugins
Last edited by Marttt; 03-16-2022 at
06:37
.
Marttt
View Public Profile
Send a private message to Marttt
Visit Marttt's homepage!
Find More Posts by Marttt