MRThinker Posted July 17, 2018 Share Posted July 17, 2018 hi guys. my server have a big problem. The money and the player's skins can not be saved when they leave the server and when they arrive they do not have the money and the skins themselves! Give me a script to solve the problem. Link to comment
MRThinker Posted July 17, 2018 Author Share Posted July 17, 2018 @Infinity# you can help me ? Link to comment
itHyperoX Posted July 17, 2018 Share Posted July 17, 2018 Give me a script to solve the problem. wtf setAccountData getAccountData givePlayerMoney setElementModel Link to comment
MRThinker Posted July 17, 2018 Author Share Posted July 17, 2018 15 minutes ago, TheMOG said: Give me a script to solve the problem. wtf setAccountData getAccountData givePlayerMoney setElementModel how ? you can write script ? i dont know this script Link to comment
Erknneto Posted July 17, 2018 Share Posted July 17, 2018 function playerLogin () local account = getPlayerAccount(source) if ( account ) then --check if the account exists local skin = (getAccountData(account,"skin") or 0) --get the skin from the account data local money = (getAccountData(account,"money") or 0) --get the money acount from the account data setElementModel(source,skin) --set the skin saved setPlayerMoney(source,money) --set the money acount saved end end addEventHandler("onPlayerLogin",getRootElement(),playerLogin) function playerLeaves () local account = getPlayerAccount(source) --get the player's account if ( account ) then --check if the acc exists local skin = getElementModel(source) --get the current skin local money = getPlayerMoney(source) --get the current money count setAccountData(account,"skin",skin) --save the skin model in the account data setAccountData(account,"money",money) --save the money acount in the account data end end addEventHandler("onPlayerQuit",getRootElement(),playerLeaves) This might work. (must be serverside) 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