Jump to content

Problem with JasperNL=D trucker job


Gamekiller

Recommended Posts

Hello,

Since a while i learned a little scripting

and i tryed to make more Places to deliver good's for the trucker job

but i got one problem

It seems always to get the same problem no matther what i try to do

the script at it self is a bug already but the problem is

alway's unexpect symbol near 'or'

Normal Script

--Truckerjob 
  
  
function truckerJob ( theTruck ) 
  theTruckVehicle = theTruck 
  theTruckTrailer = source 
  theTruckTrailerID = getElementModel (source) 
  local theDriver = getVehicleOccupant ( theTruck, 0 ) 
    if ( theDriver ) and ( theTruckTrailerID == 584 ) then 
      outputChatBox ("bring the goods to the flag.", theDriver, 255, 0, 0, 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 ) 
  theMarkerID = getElementID (theFinishMarker) 
  if (source == theFinishMarker) then 
    givePlayerMoney ( hitPlayer, 35000 ) 
    destroyElement ( theFinishMarker ) 
    destroyElement ( theFinishBlip ) 
    respawnVehicle ( theTruckTrailer ) 
    outputChatBox ( "You have deliverd the goods", 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) 

Edited script

--Truckerjob 
function truckerJobMarkerHit ( hitPlayer, matchingDimension ) 
  theMarkerID = getElementID (theFinishMarker or theFinishMarker2 or theFinishMarker3 or theFinishMarker4 ) 
  if (theFinishMarker or theFinishMarker2 or theFinishMarker3 or theFinishMarker4 ) then 
    givePlayerMoney ( hitPlayer, 5000 ) 
    destroyElement ( theFinishMarker or theFinishMarker2 or theFinishMarker3 or theFinishMarker4  ) 
    destroyElement ( theFinishBlip or theFinishBlip2 or theFinishBlip3 or theFinishBlip4 ) 
    respawnVehicle ( theTruckTrailer ) 
    outputChatBox ( "You have Deliverd the goods here is $5.000,-", hitPlayer, 255, 0, 0, false ) 
  end 
end 
addEventHandler ("onMarkerHit", getRootElement(), truckerJobMarkerHit) 
  
function truckerJob ( theTruck ) 
  theTruckVehicle = theTruck 
  theTruckTrailer = source 
  theTruckTrailerID = getElementModel (source) 
  local theDriver = getVehicleOccupant ( theTruck, 0 ) 
    if ( theDriver ) and ( theTruckTrailerID == 584 ) then 
      outputChatBox ("Bring the goods to the Flag in the Mini-map", theDriver, 255, 0, 0, false) 
      theFinishMarker = createMarker ( -1605.90, -2713.98, 46.53, "cylinder", 16, 0, 255, 0, 90, theDriver ) 
      or 
      theFinishMarker2 = createMarker ( -480.59, -514.02, 23.51, "cylinder", 16, 0, 255, 0, 90, theDriver ) 
      or 
      theFinishMarker3 = createMarker ( -771.58, -119.03, 63.34, "cylinder", 16, 0, 255, 0, 90, theDriver ) 
      or 
      theFinishMarker4 = createMarker ( 344.08, 873.30, 18.40, "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 ) 
      or 
      theFinishBlip2 = createBlip ( -480.59, -514.02, 23.51, 53, 2, 255, 0, 0, 255, 0, 99999.0, theDriver ) 
      or 
      theFinishBlip3 = createBlip ( -771.58, -119.03, 63.34, 53, 2, 255, 0, 0, 255, 0, 99999.0, theDriver ) 
      or 
      theFinishBlip4 = createBlip ( 344.08, 873.30, 18.40, 53, 2, 255, 0, 0, 255, 0, 99999.0, theDriver ) 
    end 
       end 
addEventHandler("onTrailerAttach", getRootElement(), truckerJob) 
  
function truckerJobFailed ( theTruck ) 
  removeEventHandler ("onMarkerHit", getRootElement(), truckerJobMarkerHit) 
  local theDriver = getVehicleOccupant ( theTruck, 0 ) 
  respawnVehicle ( theTruckTrailer ) 
  destroyElement ( theFinishMarker ) 
  destroyElement ( theFinishBlip ) 
  outputChatBox ( "You Failed to deliver the goods!", theDriver, 255, 0, 0, false ) 
end 
addEventHandler("onTrailerDetach", getRootElement(), truckerJobFailed) 

I've tryed many things to fix it,

but it dint realy work,

if you can help me i would be happy ,

Regards Jordy

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...