Noneatme

Untitled

Jan 27th, 2012
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.59 KB | None | 0 0
  1. addCommandHandler("waffentruck",
  2. function(thePlayer)
  3.     local frak = getPlayerFraktion(thePlayer)
  4.     if(frak == 0) or (frak == 3) then outputChatBox("Du bist nicht authorisiert!", thePlayer, 200, 0, 0, false) return end
  5.     local veh = getPedOccupiedVehicle(thePlayer)
  6.     if not(veh) then outputChatBox("Du musst in deinem Fraktions-Flatbed sein!", thePlayer, 200, 0, 0, false) return end
  7.         if(getElementModel(veh) == 455) and (getElementData(veh, "Besitzer") == fraktionNamen[frak]) then
  8.             if(getElementData(thePlayer, "waffentruck") == true) then outputChatBox("Du machst bereits ein Waffentruck!", thePlayer, 200, 0, 0, false) return end
  9.             if(state == 1) then outputChatBox("Es faehrt bereits ein Waffentruck!", thePlayer, 200, 0, 0, false) return end
  10.             setElementData(thePlayer, "waffentruck", true)
  11.             outputChatBox("Du hast die Waffentruck-Mission gestartet. Fahre zum Checkpoint und Lade die Waffen auf!", thePlayer, 0, 200, 0, false)
  12.             wMarker = createMarker(waffen1, waffen2, waffen3, "cylinder", 5.0, 200, 255, 255, 255, thePlayer)
  13.             wBlip = createBlip(waffen1, waffen2, waffen3, 51, 2, 255, 0, 0, 255, 0, 99999.0, thePlayer)
  14.             state = 1
  15.             addEventHandler("onMarkerHit", wMarker,
  16.                 function(hitElement)
  17.                 if(getElementType(hitElement) == "player") then return end
  18.                 local player = getVehicleOccupand(hitElement)
  19.                 if not(player == thePlayer) then return end
  20.                 outputChatBox("Bitte Warte nun. Du laedst auf. Entferne dich nicht!", player, 0, 200, 0, false)
  21.                     setTimer(
  22.                     function()
  23.                     destroyElement(wMarker)
  24.                     destroyElement(wBlip)
  25.                     outputChatBox("Fahre nun wieder zurueck zu deiner Base!", player, 0, 200, 0, false)
  26.                     local x1 = gettok(bases[getPlayerFraktion(player)], 1, ",")
  27.                     local y1 = gettok(bases[getPlayerFraktion(player)], 2, ",")
  28.                     local z1 = gettok(bases[getPlayerFraktion(player)], 3, ",")
  29.                     wMarker = createMarker(x1, y1, z1, "corona", 3.0, 255, 255, 255, 255, player)
  30.                     wBlip = createBlip(x1, y1, z1, 51, 2, 255, 0, 0, 255, 0, 99999.0, player)
  31.                     addEventHandler("onMarkerHit", wMarker,
  32.                     function(hitElement2)
  33.                     if(getElementType(hitElement2) == "player") then return end
  34.                     if not(hitElement2 == thePlayer) then return end
  35.                     local player2 = getVehicleOccupand(hitElement2)
  36.                     if not(player2 == thePlayer) then return end
  37.                     outputChatBox("Waffentruck Erfolgreich!", player2, 0, 200, 0, false)
  38.                     destroyElement(wMarker)
  39.                     destroyElement(wBlip)
  40.                     state = 0
  41.                     end)
  42.                     end, 30000, 1)
  43.                 end)
  44.         else -- Flatbed
  45.             outputChatBox("Du bist nicht in deinem Fraktions-Flatbed!", thePlayer, 200, 0, 0, false)
  46.         end
  47. end)
Advertisement
Add Comment
Please, Sign In to add comment