Jump to content

[HELP]Event


Black2

Recommended Posts

There is currently no event that is triggered upon player registration. But say you wanted to create a custom event for use when someone registers using the "register" command, you could use this (not tested, and not guaranteed to work, but instead provided as a basis to be worked upon):

addEvent("onPlayerRegister", true) 
addEventHandler("onPlayerRegister", root, 
    function (source) 
        setPlayerTeam(source, getTeamFromName("foo")) 
    end 
) 
  
function handleCommand(cmd) 
    -- This will work when they use register, nothing to check if they actually did it successfully 
    if (cmd == "register") then 
        -- We trigger the event and pass the source (the client who actually wrote the command) 
        triggerEvent("onPlayerRegister", source) 
    end 
end 
addEventHandler("onPlayerCommand", root, handleCommand) 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...