Jump to content

skin problem


Recommended Posts

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

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