Karuzo Posted January 25, 2014 Share 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 Link to comment
Spajk Posted January 25, 2014 Share 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. Link to comment
Karuzo Posted January 25, 2014 Author Share 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. Link to comment
Dealman Posted January 25, 2014 Share Posted January 25, 2014 triggerClientEvent triggerServerEvent You use those to transfer data between client(s) and the server. Link to comment
Spajk Posted January 25, 2014 Share 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") Link to comment
Karuzo Posted January 26, 2014 Author Share Posted January 26, 2014 Hmm i tried that but didn't worked... Link to comment
Spajk Posted January 26, 2014 Share 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 ? Link to comment
Karuzo Posted January 26, 2014 Author Share 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 Link to comment
Spajk Posted January 26, 2014 Share 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. Link to comment
Karuzo Posted January 26, 2014 Author Share Posted January 26, 2014 Sure, Client: http://pastebin.com/j2JGBGnU Server: http://pastebin.com/HbfpbKbC Link to comment
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