Doongogar Posted February 21, 2023 Posted February 21, 2023 function MarkerEntregaFunction(thePlayer) if isPedInVehicle(thePlayer) then 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, "Entregou2", true) end end end addEventHandler("onMarkerHit", MarkerEntrega, MarkerEntregaFunction) erro na segunda linha tentei usar getPedOccupiedVehicle(thePlayer) e deu o mesmo erro...
Other Languages Moderators Lord Henry Posted February 21, 2023 Other Languages Moderators Posted February 21, 2023 Que erro? Mande a mensagem do erro.
Doongogar Posted February 21, 2023 Author Posted February 21, 2023 1 hour ago, Lord Henry said: Que erro? Mande a mensagem do erro.
Other Languages Moderators Lord Henry Posted February 21, 2023 Other Languages Moderators Posted February 21, 2023 Ele está reclamando que thePlayer é um veículo e não um pedestre. Isso acontece se você encostar no marker dentro de um veículo, isso faz com que ele ative 2x, um pro veículo e outra pro jogador. Para evitar que ele considere o veículo, apenas adicione isso no começo da sua função: if getElementType(thePlayer) ~= "player" then return end -- Se o tipo de thePlayer for diferente de um jogador, então cancela a função e nada acontece. 1
Recommended Posts