View Single Post
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 03-22-2020 , 04:59   Re: [CSGO] Entity name not pulling back
Reply With Quote #10

Quote:
Originally Posted by Dragokas View Post
or better:
or better:
PHP Code:
if (strncmp(classname"trigger"7) == 0
To match all "trigger" entities like OP was attempting. But since you know which trigger specifically I would match the whole classname in this case anyway.


Quote:
Originally Posted by DJ Tsunami View Post
Entity properties are not yet available in OnEntityCreated, you need to wait until the entity is spawned.
This was most likely the problem. When using OnEntityCreated you have to wait for the properties to be valid so hook the entity with SDKHook_SpawnPost and it should work. Some things require RequestFrame within SpawnPost to delay it even more before getting valid properties but I've only noticed this is required for getting the velocity of a projectile. See the [TUT] I wrote for more details.
__________________
Silvers is offline