Jump to content

Skin Saver & stat saver aint working


Recommended Posts

Posted (edited)

Ive got a team saver working but I cant get the stat and skin saver working

Heres the scripts -- I got skin saver working but I cant change skin and on join it doesnt set skin only when you die

--SkinSaver--

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 
  
function onPlayerWasted ( ) 
      local playeraccount = getPlayerAccount ( source ) 
      if ( playeraccount ) then 
            local playerskin = getPedSkin ( source ) 
            setAccountData ( playeraccount, "skin", playerskin ) 
      end 
end 
  
addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) 
addEventHandler ( "onPlayerJoin", getRootElement ( ), onPlayerJoin ) 
addEventHandler ( "onPlayerSpawn", getRootElement ( ), onPlayerSpawn ) 
addEventHandler ( "onPlayerWasted", getRootElement ( ), onPlayerWasted ) 
  
--stat saver-- 
function onPlayerQuit ( ) 
    local account = getPlayerAccount ( source ) then 
    if ( playeraccount ) then 
            local playerstats = getPlayerStats ( source ) 
            setAccountData ( playeraccount, "stats", playerskin ) 
        end 
end 
addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) 
  
function onPlayerJoin ( ) 
      local playeraccount = getPlayerAccount ( source ) 
      if ( playeraccount ) then 
            local playerstats = getAccountData ( playeraccount, "stats" ) 
            if ( playerstats ) then 
                  setPlayerStats ( source, playerstats ) 
            end 
             
      end 
end 
addEventHandler ( "onPlayerJoin", getRootElement ( ), onPlayerJoin ) 
  
function onPlayerSpawn ( ) 
      local playeraccount = getPlayerAccount ( source ) 
      if ( playeraccount ) then 
            local playerstats = getAccountData ( playeraccount, "stats" ) 
            if ( playerstats ) then 
                  setPlayerStats ( source, playerstats ) 
            end 
      end 
end 
addEventHandler ( "onPlayerSpawn", getRootElement ( ), onPlayerSpawn ) 
  
function onPlayerWasted ( ) 
      local playeraccount = getPlayerAccount ( source ) 
      if ( playeraccount ) then 
            local playerstats = getPlayerStats ( source ) 
            setAccountData ( playeraccount, "stats", playerstats ) 
      end 
end 
addEventHandler ( "onPlayerWasted", getRootElement ( ), onPlayerWasted ) 

Edited by Guest
Posted

Can Some One Please Help Me Out with this?

And Could some one help me with a gun saver.

- People are complaining that their stats guns and skins are disapering every time they leave can some one please help

Posted

Forget what the above user said, account data can do the job as well.

Do you get any error in the debugscript ( /debugscript 3 in chat )?

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