Ittvan pl. a job-systemből kiszedve:
function startBusJob()
local job = getElementData(getLocalPlayer(), \"job\")
if (job == 3) then
if blip then
destroyElement(blip)
blip = nil
end
if busMarker then
outputChatBox(\"#FF9933Már van egy elindítod útvonalad.\", 255, 194, 14, true)
else
local vehicle = getPedOccupiedVehicle(getLocalPlayer())
if vehicle and getVehicleController(vehicle) == getLocalPlayer() and bus[getElementModel(vehicle)] then
line = math.random( 1, #g_bus_routes )
route = g_bus_routes[line]
curCpType = 0
local x, y, z = 1811, -1890, 13 -- Depot start point
busBlip = createBlip(x, y, z, 0, 3, 255, 200, 0, 255)
busMarker = createMarker(x, y, z, \"checkpoint\", 4, 255, 200, 0, 150) -- start marker.
busStopColShape = createColSphere(0, 0, 0, 5)
addEventHandler(\"onClientMarkerHit\", busMarker, updateBusCheckpointCheck)
addEventHandler(\"onClientMarkerLeave\", busMarker, checkWaitAtStop)
addEventHandler(\"onClientColShapeHit\", busStopColShape,
function(element)
if getElementType(element) == \"vehicle\" and bus[getElementModel(element)] then
setVehicleLocked(vehicle, false)
end
end
)
addEventHandler(\"onClientColShapeLeave\", busStopColShape,
function(element)
if getElementType(element) == \"vehicle\" and bus[getElementModel(element)] then
setVehicleLocked(vehicle, true)
end
end
)
local nx, ny, nz = route.points[1][1], route.points[1][2], route.points[1][3]
if (route.points[1][4]==true) then
busNextMarker = createMarker( nx, ny, nz, \"checkpoint\", 2.5, 255, 0, 0, 150) -- small red marker
busNextBlip = createBlip( nx, ny, nz, 0, 2, 255, 0, 0, 255) -- small red blip
else
busNextMarker = createMarker( nx, ny, nz, \"checkpoint\", 2.5, 255, 200, 0, 150) -- small yellow marker
busNextBlip = createBlip( nx, ny, nz, 0, 2, 255, 200, 0, 255) --small yellow blip
end
m_number = 0
triggerServerEvent(\"payBusDriver\", getLocalPlayer(), line, 0)
setVehicleLocked(vehicle, true)
outputChatBox(\"#FF9933Fordulj meg a busszal #FFCC00kövesd az útvonalat #FF9933és piros jelzésnél #A00101állj meg #FF9933.\", 255, 194, 14, true)
outputChatBox(\"#FF9933Minden felszálló utas után pénzt kapsz.\", 255, 194, 14, true)
else
outputChatBox(\"#FF9933Előbb kéne egy busz is hozzá.\", 255, 194, 14, true)
end
end
else
outputChatBox(\"Nem vagy busz sofőr.\", 255, 194, 14)
end
end
addCommandHandler(\"startbus\", startBusJob, false, false)
Dupla hozzászólás automatikusan összefûzve. ( 2015. augusztus 20. - 18:39:12 )
hop. Bocsi nem néztem hogy ez SA:MP