Jump to content

Ajuda por favor!


Recommended Posts

mrk2 = createMarker(329.45990, 61.67885, 1.50823, "cylinder", 1.5, 255,0,0, 0)
mrk1 = createMarker(339.67804, 65.90197, 2.84165, "cylinder", 1.5, 255,0,0, 0)
mrk = createMarker (342.66888, 62.64292, 2.86276, "cylinder", 1.5, 255,255,0, 45)
npc = createPed (28, 340.71704, 64.24253, 3.84022 )
local blip = createBlip (342.66888, 62.64292, 2.86276, 23, 0, 0, 0, 255)


function msg(player)
outputChatBox("#ffffff Escreva #FF0000 /maconha #ffffff para abrir o painel", player, 255,255,255, true)
end
addEventHandler("onMarkerHit", mrk, msg)


function  nohitnpc()
	cancelEvent()
end
addEventHandler("onClientPedDamage", npc, nohitnpc)

function droga (thePlayer)
    local x, y, z = getElementPosition (thePlayer)
  function setAnimation( thePlayer )
	setPedAnimation (thePlayer,"CARRY", "liftup", -1, false, false, false)
	end
	addEventHandler("onMarkerHit", mrk1, setAnimation)
    local objPick = createObject (1578, 0, 0, 0)
    setTimer (function (thePlayer)
	local function endAnimation( thePlayer )
	setPedAnimation (thePlayer, nil)
	end
	addEventHandler("onMarkerHit", mrk2, endAnimation)
        exports.bone_attach:attachElementToBone (objPick, thePlayer, 4, -0.3, 0.2, 0, -125, 0, 0)
    end, 1000, 1, thePlayer)
end
addEventHandler ("onMarkerHit", mrk1, droga)

Quando o personagem vai em cima do mrk1 a animação fica travada e o personagem não anda.

Link to comment

O que aparece no /debugscript 3 ? 

Parece que tu esqueceu de um end na local function endAnimation( thePlayer ).

mrk2 = createMarker(329.45990, 61.67885, 1.50823, "cylinder", 1.5, 255,0,0, 0)
mrk1 = createMarker(339.67804, 65.90197, 2.84165, "cylinder", 1.5, 255,0,0, 0)
mrk = createMarker (342.66888, 62.64292, 2.86276, "cylinder", 1.5, 255,255,0, 45)
npc = createPed (28, 340.71704, 64.24253, 3.84022 )
local blip = createBlip (342.66888, 62.64292, 2.86276, 23, 0, 0, 0, 255)

function msg(player)
    outputChatBox("#ffffff Escreva #FF0000 /maconha #ffffff para abrir o painel", player, 255,255,255, true)
end
addEventHandler("onMarkerHit", mrk, msg)

function  nohitnpc()
	cancelEvent()
end
addEventHandler("onClientPedDamage", npc, nohitnpc)

function droga (thePlayer)
    local x, y, z = getElementPosition (thePlayer)

    function setAnimation( thePlayer )
	    setPedAnimation (thePlayer,"CARRY", "liftup", -1, false, false, false)
	end
    addEventHandler("onMarkerHit", mrk1, setAnimation)
    
    local objPick = createObject (1578, 0, 0, 0)

    setTimer (
        function (thePlayer)
      	------------Problema
          local function endAnimation( thePlayer )
              setPedAnimation (thePlayer, nil)
          end -- Esqueceu de fechar essa function
	end
	addEventHandler("onMarkerHit", mrk2, endAnimation)
        exports.bone_attach:attachElementToBone (objPick, thePlayer, 4, -0.3, 0.2, 0, -125, 0, 0)
    end, 1000, 1, thePlayer)
end
addEventHandler ("onMarkerHit", mrk1, droga)

 

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