here is file ; and it got bugs like when 2 players got trailers in one time and one of them gets money when he reach final and another not ;
but mostly it says in server panel bad element pointer at line 28 ; maybe someone knows how to fix it or set that element id ( circle ) ? u can see taht line 30 at the end of this
function truckerJob ( theTruck )
theTruckVehicle = theTruck
theTruckTrailer = source
theTruckTrailerID = getElementModel (source)
local theDriver = getVehicleOccupant ( theTruck, 0 )
if ( theDriver ) and ( theTruckTrailerID == 584 ) then
outputChatBox ("Bring the trailer to the flag.", theDriver, 0, 255, 111, false)
theFinishMarker = createMarker ( -1605.90, -2713.98, 46.53, "cylinder", 16, 0, 255, 0, 90, theDriver )
theFinishBlip = createBlip ( -1605.90, -2713.98, 46.53, 53, 2, 255, 0, 0, 255, 0, 99999.0, theDriver )
end
if ( theDriver ) and ( theTruckTrailerID == 435 ) then
outputChatBox ("Bring the trailer to the flag.", theDriver, 255, 0, 0, false)
theFinishMarker = createMarker ( -480.59, -514.02, 23.51, "cylinder", 16, 0, 255, 0, 90, theDriver )
theFinishBlip = createBlip ( -480.59, -514.02, 23.51, 53, 2, 255, 0, 0, 255, 0, 99999.0, theDriver )
end
if ( theDriver ) and ( theTruckTrailerID == 450 ) then
outputChatBox ("Bring the trailer to the flag.", theDriver, 255, 0, 0, false)
theFinishMarker = createMarker ( -771.58, -119.03, 63.34, "cylinder", 16, 0, 255, 0, 90, theDriver )
theFinishBlip = createBlip ( -771.58, -119.03, 63.34, 53, 2, 255, 0, 0, 255, 0, 99999.0, theDriver )
end
if ( theDriver ) and ( theTruckTrailerID == 591 ) then
outputChatBox ("Bring the trailer to the flag.", theDriver, 255, 0, 0, false)
theFinishMarker = createMarker ( 344.08, 873.30, 18.40, "cylinder", 16, 0, 255, 0, 90, theDriver )
theFinishBlip = createBlip ( 344.08, 873.30, 18.40, 53, 2, 255, 0, 0, 255, 0, 99999.0, theDriver )
end
function truckerJobMarkerHit ( hitPlayer, matchingDimension )
[b]theMarkerID = getElementID (theFinishMarker)[/b]
if (source == theFinishMarker) then
givePlayerMoney ( hitPlayer, 150 )
destroyElement ( theFinishMarker )
destroyElement ( theFinishBlip )
respawnVehicle ( theTruckTrailer )
outputChatBox ( "Mission Passed, you earn $150", hitPlayer, 255, 0, 0, false )
end
end
addEventHandler ("onMarkerHit", getRootElement(), truckerJobMarkerHit)
end
addEventHandler("onTrailerAttach", getRootElement(), truckerJob)
function truckerJobFailed ( theTruck )
removeEventHandler ("onMarkerHit", getRootElement(), truckerJobMarkerHit)
local theDriver = getVehicleOccupant ( theTruck, 0 )
respawnVehicle ( theTruckTrailer )
destroyElement ( theFinishMarker )
destroyElement ( theFinishBlip )
outputChatBox ( "Mission Failed!", theDriver, 255, 0, 0, false )
end
addEventHandler("onTrailerDetach", getRootElement(), truckerJobFailed)