Jump to content

AJUDA SCRIPT


Recommended Posts

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
Link to comment
  • Scripting Moderators

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.

Link to comment

É 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)

 

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