alowner Posted February 26, 2020 Share Posted February 26, 2020 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
Gaimo Posted February 29, 2020 Share Posted February 29, 2020 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now