Jump to content

I'm New(sou novo)


lipewws

Recommended Posts

4 hours ago, lipewws said:

How to config a server to stay with the same skin you die? (como configurar um servidor para ficar com a mesma skin que você morreu?)

 

I think you can do that with 

setElementData()
getElementData()
onPlayerWasted() (server-side)
or
onClientPlayerWasted() (client-side)

 

Link to comment
14 hours ago, lipewws said:

thanks, but where I put that?

 

 

make a server.lua file and put this code:

function saveModelSkin()
modelSkin = getElementModel(source)
setElementData(source, "saveSkin", modelSkin)
setElementModel(source, modelSkin)
end
addEventHandler("onPlayerJoin", getRootElement(), saveModelSkin)

function saveModelData2()
modelS = getElementModel(source)
setElementData(source, "saveSkin", modelS)
setElementModel(source, modelS)
end
addEventHandler("onElementModelChange", getRootElement(), saveModelData2)

function loadModelSkin()
getModelSaved = getElementData(source, "saveSkin") or 0
setElementModel(source, getModelSaved)
end
addEventHandler("onPlayerSpawn", getRootElement(), loadModelSkin)

 

Link to comment
On 06/11/2020 at 08:22, Hydra said:

make a server.lua file and put this code:

function saveModelSkin()
modelSkin = getElementModel(source)
setElementData(source, "saveSkin", modelSkin)
setElementModel(source, modelSkin)
end
addEventHandler("onPlayerJoin", getRootElement(), saveModelSkin)

function saveModelData2()
modelS = getElementModel(source)
setElementData(source, "saveSkin", modelS)
setElementModel(source, modelS)
end
addEventHandler("onElementModelChange", getRootElement(), saveModelData2)

function loadModelSkin()
getModelSaved = getElementData(source, "saveSkin") or 0
setElementModel(source, getModelSaved)
end
addEventHandler("onPlayerSpawn", getRootElement(), loadModelSkin)

 

thanks I'll try that

 

 

Link to comment
On 06/11/2020 at 08:22, Hydra said:

make a server.lua file and put this code:

function saveModelSkin()
modelSkin = getElementModel(source)
setElementData(source, "saveSkin", modelSkin)
setElementModel(source, modelSkin)
end
addEventHandler("onPlayerJoin", getRootElement(), saveModelSkin)

function saveModelData2()
modelS = getElementModel(source)
setElementData(source, "saveSkin", modelS)
setElementModel(source, modelS)
end
addEventHandler("onElementModelChange", getRootElement(), saveModelData2)

function loadModelSkin()
getModelSaved = getElementData(source, "saveSkin") or 0
setElementModel(source, getModelSaved)
end
addEventHandler("onPlayerSpawn", getRootElement(), loadModelSkin)

 

I put the file in the Play archive?

 

Link to comment
  • Scripting Moderators
On 06/11/2020 at 14:22, Hydra said:

make a server.lua file and put this code:

function saveModelSkin()
modelSkin = getElementModel(source)
setElementData(source, "saveSkin", modelSkin)
setElementModel(source, modelSkin)
end
addEventHandler("onPlayerJoin", getRootElement(), saveModelSkin)

function saveModelData2()
modelS = getElementModel(source)
setElementData(source, "saveSkin", modelS)
setElementModel(source, modelS)
end
addEventHandler("onElementModelChange", getRootElement(), saveModelData2)

function loadModelSkin()
getModelSaved = getElementData(source, "saveSkin") or 0
setElementModel(source, getModelSaved)
end
addEventHandler("onPlayerSpawn", getRootElement(), loadModelSkin)

 

Just to put a note here you should disable the synchronize here because it's useless
https://wiki.multitheftauto.com/wiki/SetElementData
It's the fourth arguments

  • Like 1
  • 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...