Jump to content

House System by NoneAtMe problem


Karuzo

Recommended Posts

Hey Guys,

i have a few problems,

i want to make the house system just like that : i want it that the owner is taken from his account name..

I know i have to use getAccountName(theAccount) , but how do i take the account-name clientsided ??

i replaced every getplayerfromname serversided with getAccountName...

Edited by Guest
Link to comment

I don't have any idea how that script works, but here's the code that you can use to get player's account name client-side:

addEventHandler("onPlayerLogin", root, 
    function(_, acc) 
        setElementData(source, "accountName", getAccountName(acc)) 
    end 
) 
  
addEventHandler("onPlayerLogout", root, 
    function() 
        removeElementData(source, "accountName") 
    end 
) 

Then on the client-side you can just use:

getElementData(player, "accountName") 

Link to comment
addEventHandler("onPlayerLogin", root, 
    function(_, acc) 
        setElementData(source, "accountName", getAccountName(acc)) 
    end 
) 
  
addEventHandler("onPlayerLogout", root, 
    function() 
        removeElementData(source, "accountName") 
    end 
) 

Are you sure you have put this to the server-side script ?

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