Whenever I try to create a new class object with enew of a player element, it throws a warning to the debug log, saying that onElementDestroy event is already being handled by the function, how is this possible? MTA restricts listening to certain player events?
enew( getPlayerFromName( 'Socialz' ), classes.player )
WARNING: classlib.lua:59: Bad usage @ 'addEventHandler' ['onElementDestroy' with this function is already handled]
I added getElementType(element) ~= 'player' to my version, but if I understand it right, we should never ignore this event as it deletes stuff from memory and if it's never deleted we have a memory leak.
Using onPlayerQuit instead of onElementDestroy did not resolve the warning.