Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 16/12/21 in all areas

  1. You can use Object Preview to draw it in front of the player. https://community.multitheftauto.com/index.php?p=resources&s=details&id=11836
    1 point
  2. If you are sure players will exit the car before it being drowned there could be a chance to do this.
    1 point
  3. I don't think that saying someone is talented is negative or defamatory. Anyway, on topic, from my experience with your work I'm sure you have the talent to complete this project and probably anything else like it.
    1 point
  4. Faltou a parte em que deixa os markers visíveis quando a pessoa entra no emprego né, mas você não postou essa parte... Mas acho que com o que eu já mandei você consegue se virar para implementar essa parte kkk
    1 point
  5. Você está passando o source como parâmetro, nunca faça isso! O source é o marker que foi "hitado", o 1° argumento é o hitElement (pode ser um carro, player, objeto etc...). Você quer fazer uma função mais genérica né, eu estou meio sem tempo pra algo perfeitinho mas ficaria mais ou menos assim: local posLixeiras = { [1] = {1983.001, -1744.44, 13.547}, [2] = {1993.668, -1738.607, 13.547}, } local Lixeiras = {} local blipLixeiras = {} addEventHandler('onResourceStart', resourceRoot, function () for i, pos in ipairs (posLixeiras) do Lixeiras[i] = createMarker(pos[1], pos[2], pos[3], "cylinder", 1.2, 70, 58, 88, 100) blipLixeiras[i] = createBlipAttachedTo(Lixeiras[i], 2) setBlipVisibleDistance(blipLixeiras[i], 2000) setElementVisibleTo(blipLixeiras[i], root, false) setElementVisibleTo(Lixeiras[i], root, false) setElementVisibleTo(Lixeiras[i], root, false) addEventHandler("onMarkerHit", Lixeiras[i], PegarLixo) end end) function getMarkerPositionInTable (marker) for i, m in ipairs (Lixeiras) do if marker == m then return i end end return false end function PegarLixo(hitElement) if getElementData(hitElement, "Lixeiro") then local i = getMarkerPositionInTable(source) if not i then return end local random = math.random(4, 20) exports["Bahamas_Inventory"]:BHM_GiveItem(hitElement, "dollars", random) setElementVisibleTo(Lixeiras[i], hitElement, false) setElementVisibleTo(blipLixeiras[i], hitElement, false) setElementFrozen(hitElement, true) setTimer(triggerClientEvent, 1100, 1, hitElement, "progressService", root, 6, "") setPedAnimation(hitElement, "uzi", "uzi_reload", 6500, true, false, false, false) setTimer(function() exports['infobox']:showInfobox(hitElement, "Você recolheu oque estava nessa lata de lixo", "success") setElementFrozen(hitElement, false) end, 6500, 1) end end Para adicionar novas lixeiras é só colocar novas posições no posLixeiras, conforme os exemplos. Obs: Mudei muita coisa no seu script e não testei, teste aí e traga possíveis erros que possam dar no console (digite "/debugscript 3" e fique de olho enquanto testa).
    1 point
×
×
  • Create New...