Hello everyone, I'm somewhat new to Pawn, and I'm getting an error while working entities when I use GetEntProp.
The error looks like this in the console / SM logs:
Code:
[SM] Native "GetEntProp" reported: Entity -1 (-1) is invalid
I'm hooking SDKHook_Spawn for tf_projectile_rocket.
I'm then using GetEntProp, to get the owner of the rocket:
Code:
//Condition is true if the rocket's owner's rocket launcher is level 101 (normally impossible to get unless using asherkins TF2 items extention)
if( IsClientInGame(iOwner) && IsPlayerAlive(iOwner) && GetEntProp(GetEntPropEnt(iOwner, Prop_Send, "m_hActiveWeapon"), Prop_Send, "m_iEntityLevel") == 101)
And that's where I'm getting that error. Anyone have any pointers? Is there a condition that i should be checking for before calling GetEntProp?
Also, I just want to clarify, the above DOES work, however my console gets spammed with that error sometimes (it's either spamming like crazy, or not at all).
__________________