Jump to content

Occupation


yMassai

Recommended Posts

    pizzao = setElementData( source, "Occupation", "Entregador de Pizza", true ) 
  
function pQuit ( ) 
        setAccountData(source,"job",pizzao) 
end 
addEventHandler ( "onPlayerQuit", root, pQuit ) 
  
function onPlayerLogin ( ) 
    getAccountData ( pizzao, "job" ) 
    setElementData (source, pizzao) 
end 
addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayerLogin ) 

why dont work?

Link to comment
  • Other Languages Moderators

Not sure if this what you want.

function pQuit() 
     local account = getPlayerAccount(source) 
     if (account) and not isGuestAccount(account) then 
          setAccountData(account,"job",getElementData(source, "Occupation")) 
     end 
end 
addEventHandler("onPlayerQuit", root, pQuit) 
  
function onPlayerLogin(_,acc) 
    setElementData(source, "Occupation",getAccountData(acc, "job")) 
end 
addEventHandler("onPlayerLogin", root, onPlayerLogin) 

Link to comment
Guest Guest4401
addEventHandler("onPlayerQuit",root, 
    function() 
        local account = getPlayerAccount(source) 
        if not isGuestAccount(account) then 
            setAccountData(account,"job",getElementData(source,"Occupation")) 
        end 
    end 
) 
  
addEventHandler("onPlayerLogin",root, 
    function(old,new) 
        setElementData(source,"job",getAccountData(new,"job")) 
    end 
) 

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...