Jump to content

Alguem pode me ajudar como fazer um script pra morrer ou deslogar do servidor sem perder skin ou trocar


Recommended Posts

root = getRootElement()
tempo = 2000 -- 2s p/ carregar a skin apos morrer/Logar !

--/> MORRER 
function salvar_skin ()
   local skin = getPedSkin(source)
   setTimer (setElementModel, tempo, 1, source, skin, true)
end
addEventHandler ( "onPlayerWasted", root, salvar_skin )

--/> QUIT / Salvar no Element "skin_salva"
function quit_salvar_skin ()
   local conta = getPlayerAccount(source)
   setAccountData (conta, "skin_salva", tostring (getPedSkin(source)))
end
addEventHandler ( "onPlayerQuit", root, quit_salvar_skin )

--/> LOGIN / Carregará
function playerLogin (_, account)
   local conta_date = getAccountData (account, "skin_salva")
   if conta_date then
      setTimer (setElementModel, tempo, 1, source, conta_date, true)
   end
end
addEventHandler ("onPlayerLogin", root, playerLogin)

É apenas um exemplo, se está funcional eu não sei

Edited by Lord Henry
  • Thanks 1
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...