Code:
PHP Code:
public OnEntityCreated(entity, const char[] classname)
{
if (StrContains(classname, "light", false) != -1)
{
//SDKHook(entity, SDKHook_SpawnPost, OnLightSpawnPost) // Spawn doesnt work for lights, they get removed...
float origin[3]
GetEntPropVector(entity, Prop_Send, "m_vecOrigin", origin)
LogMessage("DEBUG: Entity created: %s | Origin: %.2f, %.2f, %.2f", classname, origin[0], origin[1], origin[2])
}
}
Output:
PHP Code:
L 07/12/2020 - 04:38:09: [lighttest.smx] DEBUG: Entity created: light | Origin: 0.00, 0.00, 0.00
L 07/12/2020 - 04:38:09: [lighttest.smx] DEBUG: Entity created: light_spot | Origin: 0.00, 0.00, 0.00
L 07/12/2020 - 04:38:09: [lighttest.smx] DEBUG: Entity created: light_spot | Origin: 0.00, 0.00, 0.00
L 07/12/2020 - 04:38:09: [lighttest.smx] DEBUG: Entity created: light | Origin: 0.00, 0.00, 0.00
L 07/12/2020 - 04:38:09: [lighttest.smx] DEBUG: Entity created: light_spot | Origin: 0.00, 0.00, 0.00
L 07/12/2020 - 04:38:09: [lighttest.smx] DEBUG: Entity created: light_spot | Origin: 0.00, 0.00, 0.00
L 07/12/2020 - 04:38:09: [lighttest.smx] DEBUG: Entity created: light_environment | Origin: 0.00, 0.00, 0.00
L 07/12/2020 - 04:38:09: [lighttest.smx] DEBUG: Entity created: light | Origin: 0.00, 0.00, 0.00
L 07/12/2020 - 04:38:09: [lighttest.smx] DEBUG: Entity created: light | Origin: 0.00, 0.00, 0.00
L 07/12/2020 - 04:38:09: [lighttest.smx] DEBUG: Entity created: light | Origin: 0.00, 0.00, 0.00
L 07/12/2020 - 04:38:09: [lighttest.smx] DEBUG: Entity created: light | Origin: 0.00, 0.00, 0.00
L 07/12/2020 - 04:38:09: [lighttest.smx] DEBUG: Entity created: light | Origin: 0.00, 0.00, 0.00