Jump to content

skin problem


Recommended Posts

Posted

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.
Posted
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 :( 

Posted
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)

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