Karuzo Posted January 25, 2014 Posted January 25, 2014 (edited) 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 January 26, 2014 by Guest
Spajk Posted January 25, 2014 Posted January 25, 2014 Send the account name to the client when player logins and store it in a table, remove it once he quits/logout.
Karuzo Posted January 25, 2014 Author Posted January 25, 2014 Well it's all over MySQL , the owner is saved in the mysql, but i want it that it doesnt use getPlayerName, i want it that he uses the account name , ive done that know in the server-sided script , but i don't know how to do it in client-sided.
Dealman Posted January 25, 2014 Posted January 25, 2014 triggerClientEvent triggerServerEvent You use those to transfer data between client(s) and the server.
Spajk Posted January 25, 2014 Posted January 25, 2014 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")
Spajk Posted January 26, 2014 Posted January 26, 2014 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 ?
Karuzo Posted January 26, 2014 Author Posted January 26, 2014 Not really, i just don't know how i should replace getPlayerName with the ElementDatas.. I just uploaded the script so you can understand me better. Client: http://pastebin.com/bRkCJYzM Server: http://pastebin.com/qH4YKARS
Spajk Posted January 26, 2014 Posted January 26, 2014 Ugh, could you give me the original source-code, so I could change it so it would use account names instead of player names.
Karuzo Posted January 26, 2014 Author Posted January 26, 2014 Sure, Client: http://pastebin.com/j2JGBGnU Server: http://pastebin.com/HbfpbKbC
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now