Need help with making a "Clear Inventory on join" plugin
#5
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):
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
)
Reply
Thanks given by:


Messages In This Thread
RE: Need help with making a "Clear Inventory on join" plugin - by xoft - 10-07-2014, 05:33 AM



Users browsing this thread: 2 Guest(s)