Tematy otagowane jako: busa |
1. Usuwanie busa po dostaniu prawka |
Witam, ot?? mam taki problem ?e nie wiem jaki kod da? do tego aby usuwa?o oraz zaka?cza?o prace kiedy dostaniemy zakaz prowadzenia A/B/C.
Wiem ?e to jest bardzo banalne ale dzi? co? nie mam do tego g?owy stawiam piwko |
2. pasażerowie busa |
witam, jak zrobi? pedy, kt?re wsiadaj? jako pasa?er do busa? stawiam piwko i respekt. ps. prosi?bym o jaki? przyk?ad |
3. Praca busa |
Witam ponownie, posiadam prace busa jednakze napotka? mnie pewien b??d, ot?? nie pokazuje markera..
Kod:
[lua]local districtsBus = {
{x,y,z},
}
addEvent("givePlayerMoney", true)
addEventHandler("givePlayerMoney", resourceRoot, function()
givePlayerMoney (localPlayer, 2)
end)
local jobTarget
local jobMarker
local jobVehicle
local maxTarget = #districtsBus
function finishJob()
if jobMarker and isElement(jobMarker) then
destroyElement(jobMarker)
jobMarker = nil
end
if jobTarget and isElement(jobTarget) then
destroyElement(jobTarget)
jobTarget = nil
jobTarget = 0
end
triggerServerEvent("destroyVeh",resourceRoot,jobVehicle)
end
function busDriver(el, md)
if el ~= localPlayer or not md then return end
if jobTarget > maxTarget and getPedOccupiedVehicle(el) then return end
if jobTarget == maxTarget and not getPedOccupiedVehicle(el) then return end
if jobTarget == #districtsBus then
finishJob()
playSoundFrontEnd(5)
outputChatBox("* Zako?czy?e?/a? prac?.")
else
showMarker()
playSoundFrontEnd(12)
givePlayerMoney (20)
end
end
function showMarker()
if jobMarker and isElement(jobMarker) then
destroyElement(jobMarker)
jobMarker = nil
end
jobTarget = jobTarget + 1
jobMarker = createMarker(... |
|