Jump to content

[REQUEST] Skin save on death Request


Recommended Posts

function onPlayerQuit ( )
     local playeraccount = getPlayerAccount ( source )
     if ( playeraccount ) then
           local playerskin = getPedSkin ( source )
           setAccountData ( playeraccount, "skin", playerskin )
     end
end
 
function onPlayerJoin ( )
     local playeraccount = getPlayerAccount ( source )
     if ( playeraccount ) then
           local playerskin = getAccountData ( playeraccount, "skin" )
           if ( playerskin ) then
                 setPedSkin ( source, playerskin )
           end
     end
end
 
function onPlayerSpawn ( )
     local playeraccount = getPlayerAccount ( source )
     if ( playeraccount ) then
           local playerskin = getAccountData ( playeraccount, "skin" )
           if ( playerskin ) then
                 setPedSkin ( source, playerskin )
           end
     end
end
 
addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit )
addEventHandler ( "onPlayerJoin", getRootElement ( ), onPlayerJoin )
addEventHandler ( "onPlayerSpawn", getRootElement ( ), onPlayerSpawn )

 

Isn´t this save script for when a player leaves?

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