Jump to content

AJUDA SCRIPT


Recommended Posts

Posted (edited)

AJUDA QUERIA SABER COMO FAÇO PARA TIRA UMA SKIN DEPOIS DE SETADA NO MARKER

PESSOAL AJUDA AI QUERIA PODER TIRA A SKIN QUANDO DIGITA /sair SO ISSO MSM

---- COMANDO PARA PEGA SKIN E TRAB

function chave1(source)
	if isElementWithinMarker(source, markerchave1) then
		setMarkerSize(marker1, 1.5)
		skin = setElementModel(source, 27)
		setElementModel(source, getElementData(source, "skin"))
	end
end
addEventHandler("onMarkerHit", markerchave1, chave1)

---- COMANDO PARA SAIR DO TRAB E TIRA SKIN
function sairtrampo(source)
	if isElementWithinMarker(source, markerchave1) then
		setMarkerSize(marker1, 0)
		setElementModel(source, getElementData(source, "skin"))
		removeElementData(source, "skin")
	end
end
addCommandHandler("sair", sairtrampo)

 

Edited by Dutchman101
fixed formatting
  • Human Resources Staff
Posted

Hi,

Please make sure you're using English everywhere on the forum except the Other Languages section. If you'd like to get scripting help, please make sure you post your issue (using English) in the Scripting section, rather than this section.

If you'd like to get help into your specific language, than please make sure that you post in the appropiate section in the future. As for this topic, it will more than likely get moved to your specific language section where you'll still be able to get the help you need.

Posted
4 hours ago, Lord Henry said:

setElementModel (source, 0)

 

Mais dai vai para skin 0 do CJ queria que voltassse a skin que eu comprei na loja

  • Other Languages Moderators
Posted

E como vc espera que ele adivinhe isso? Se vc comprar várias, como quer q ele saiba qual delas colocar de volta?

  • Thanks 1
  • Haha 1
Posted

É complicado, eu indico você a fazer o seguinte, salva a skin que entrou no trabalho.

---- COMANDO PARA PEGA SKIN E TRAB

local tabela = { } --/> ADD

function chave1 ( hitElement )
   if isElement(hitElement) and getElementType(hitElement) == "player" then --/> ALTERADO
      setMarkerSize(marker1, 1.5)
      tabela[hitElement] = getElementModel(hitElement) --/> ADD
      setElementModel(hitElement, 27)
   end
end
addEventHandler("onMarkerHit", markerchave1, chave1)

---- COMANDO PARA SAIR DO TRAB E TIRA SKIN
function sair_do_trabalho ( source )
   if isElementWithinMarker(source, markerchave1) then
      setMarkerSize(marker1, 0)
      setElementModel(source, (tabela[source] or 0) ) --/> ADD
   end
end
addCommandHandler("sair", sair_do_trabalho )

addEventHandler("onPlayerQuit", root, function () --/> ADD
   if tabela[source] then tabela[source] = nil end
end)

 

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