Jump to content

Saving problem in my server


Recommended Posts

Posted

Hi Guys

 

There is a problem with my server.

Please give me a resource to help me make the player skin unchanged!

I'm killing when I'm done. Skin is converted to CJ

Please help 

P

 

Posted

I don't know if this is right, but I assume you want to keep the CJ Skin when a player dies? So what you'd do is, use on when they respawn after they die assuming it's onPlayerWasted, then set their skin to 0 using setElementModel.

Posted
function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin)		 
	if  not (isGuestAccount (getPlayerAccount (source))) then	 
	local accountSkinData = getAccountData (theCurrentAccount, "skinid")
	spawnPlayer (source, 0, 0, 1, 0, playerSkin, 0, 0)
	end
end
addEventHandler ("onPlayerLogin", getRootElement(), playerLogin)
	
	
	
function onQuit (quitType, reason, responsibleElement)
if not (isGuestAccount (getPlayerAccount (source))) then
    account = getPlayerAccount (source)
    if (account) then
	setAccountData (account, "skinid", tostring (getPedSkin (source)))
	end
end
end
addEventHandler ("onPlayerQuit", getRootElement(), onQuit)

 

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