Fixei um marker em um veiculo, fui colocar uma função no marker (onMarkerHit) porém não funcionou.
O que fiz:
mcarregar = createMarker(-1085.234, -1609.752, 75.367, "cylinder", 2, 255,100,100, 60)
Carregar = true
Van = createVehicle(482, -1086.357, -1615.635, 76.367, 0, 0, -90)
mvan = createMarker(0,0,0, "cylinder", 1, 255,100,100, 70)
function carregar ( thePlayer )
if Carregar == true then
droga = createObject (1578, 0,0,0,0,0,0, true)
setPedAnimation(thePlayer, "carry", "crry_prtial", 1, false, true)
attachElements ( mvan, Van, 0, -3, -1.2 )
attachElements ( droga, thePlayer, 0, 0.4, 0.3)
drogac = true
end
end
addEventHandler("onMarkerHit", mcarregar, carregar)
function drogaca ( player )
if drogac == true then
setPedAnimation(thePlayer, "carry", "crry_prtial", 1, false, true)
end
end
addEventHandler("onMarkerHit", mvan, drogaca)