10-07-2014, 05:33 AM
The "OnPlayerJoined" is the default name for the hook - it is used when you call the register function like this (old, deprecated but still working way):
When multiple callbacks were introduced, the functions were added as the parameter:
You could even do this:
cPluginManager.AddHook(cPluginManager.HOOK_PLAYER_JOINED)This is from the times when plugins could only register a single hook callback.
When multiple callbacks were introduced, the functions were added as the parameter:
local function AnyNameReally(a_Player) a_Player:SendMessage("Hello") end cPluginManager.AddHook(cPluginManager.HOOK_PLAYER_JOINED, AnyNameReally)
You could even do this:
cPluginManager.AddHook(cPluginManager.HOOK_PLAYER_JOINED, function (a_Player) a_Player:SendMessage("Hello") end )