Doongogar Posted February 21, 2023 Posted February 21, 2023 Quando eu hito o segundo marker da função "MarkerEntregaFunction3" não acontece nada nem da nenhum erro function MarkerEntregaFunction(thePlayer) if getElementType(thePlayer) ~= "player" then return end if isPedInVehicle(thePlayer) then local ocupado = getPedOccupiedVehicle(thePlayer) if getElementData(thePlayer, "EntregadorD") == true and getElementData(ocupado, "kombiEntregas") == true and getElementData(thePlayer, "Entregou") == false then givePlayerMoney(thePlayer, 1000) setElementVisibleTo(MarkerEntrega, thePlayer, false) setElementVisibleTo(BlipEntrega, thePlayer, false) setElementVisibleTo(MarkerEntrega2, thePlayer, true) setElementVisibleTo(BlipEntrega2, thePlayer, true) setElementData(thePlayer, "Entregou", true) end end end addEventHandler("onMarkerHit", MarkerEntrega, MarkerEntregaFunction) MarkerEntrega3 = createMarker(-1196.2092285156,-1028.4724121094,129.21192932129 - 1, "cylinder", 2.5, 69, 69, 69) BlipEntrega3 = createBlipAttachedTo(MarkerEntrega2, 0) setElementVisibleTo(MarkerEntrega3, root, false) setElementVisibleTo(BlipEntrega3, root, false) function MarkerEntregaFunction3(thePlayer) if getElementType(thePlayer) ~= "player" then return end if isPedInVehicle(thePlayer) then local ocupado = getPedOccupiedVehicle(thePlayer) if getElementData(thePlayer, "EntregadorD") == true and getElementData(ocupado, "kombiEntregas") == true and getElementData(thePlayer, "Entregou2") == false then givePlayerMoney(thePlayer, 1000) setElementVisibleTo(MarkerEntrega2, thePlayer, false) setElementVisibleTo(BlipEntrega2, thePlayer, false) setElementVisibleTo(MarkerEntrega3, thePlayer, true) setElementVisibleTo(BlipEntrega3, thePlayer, true) setElementData(thePlayer, "Entregou2", true) end end end addEventHandler("onMarkerHit", MarkerEntrega3, MarkerEntregaFunction3)
Other Languages Moderators Lord Henry Posted February 24, 2023 Other Languages Moderators Posted February 24, 2023 Depure seu código com vários outputChatBox para saber até qual linha ele está lendo, descobrindo assim qual condição está com problema. function MarkerEntregaFunction3(thePlayer) outputChatBox("A", thePlayer) if getElementType(thePlayer) ~= "player" then return end outputChatBox("B", thePlayer) if isPedInVehicle(thePlayer) then outputChatBox("C", thePlayer) local ocupado = getPedOccupiedVehicle(thePlayer) if getElementData(thePlayer, "EntregadorD") == true and getElementData(ocupado, "kombiEntregas") == true and getElementData(thePlayer, "Entregou2") == false then outputChatBox("D", thePlayer) givePlayerMoney(thePlayer, 1000) setElementVisibleTo(MarkerEntrega2, thePlayer, false) setElementVisibleTo(BlipEntrega2, thePlayer, false) setElementVisibleTo(MarkerEntrega3, thePlayer, true) setElementVisibleTo(BlipEntrega3, thePlayer, true) setElementData(thePlayer, "Entregou2", true) end end end addEventHandler("onMarkerHit", MarkerEntrega3, MarkerEntregaFunction3)
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