Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 15th, 2012  |  syntax: Lua  |  size: 2.07 KB  |  hits: 21  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. --[[local campLocations =
  2. {
  3.     {X=1494, Y=-2171, Z=13},
  4. }
  5.  
  6. for _, camp in pairs(campLocations) do
  7.    campM = createMarker(camp.X, camp.Y, camp.Z-1, "cylinder", 2, 250, 250, 0)
  8.    campCol = createColRectangle(camp.X-20, camp.Y-20, 70, 70)
  9. end]]
  10.  
  11. function detectMarkerHit(hitPlayer)
  12.                 outputChatBox("LOL")
  13. end
  14. addEventHandler("onMarkerHit", root, detectMarkerHit)
  15.  
  16. addEvent("playerBuyCampSpot", true)
  17. function playerBoughtSpot()
  18.     local campCost = 2500
  19.     local playerMoney = getPlayerMoney(source)
  20.     if (playerMoney > campCost and getPlayerWantedLevel(source) == 0) then
  21.         outputChatBox("You have bought a camping spot for $2500", source, 0, 250, 0)
  22.     else
  23.         outputChatBox("You need to have atleast $2500 and no more than 0 wanted stars!", source, 250, 0, 0)
  24.     end
  25. end
  26. addEventHandler("playerBuyCampSpot", root, playerBoughtSpot)
  27.  
  28. function enterCampInt(thePlayer)
  29.     if (isPedInVehicle(thePlayer) and not isElement(journeyInt) and getElementData(thePlayer, "campData") == "Avaliable") then
  30.         local playerVehicle = getPedOccupiedVehicle(thePlayer)
  31.         local vX, vY, vZ = getElementPosition(playerVehicle)
  32.         journeyInt = createMarker(0, 0, 0, "arrow", 2, 250, 250, 0)
  33.         journeyBlip = createBlipAttachedTo(playerVehicle, 32)
  34.         attachElements(journeyInt, playerVehicle, 2, 0.2, 1)
  35.         setElementFrozen(playerVehicle, true)
  36.         setVehicleEngineState(playerVehicle, false)
  37.   end
  38. end
  39. addCommandHandler("camp", enterCampInt)
  40.  
  41. function deleteCamp(thePlayer)
  42.     if (isPedInVehicle(thePlayer) and isElement(journeyInt)) then
  43.         local playerVehicle = getPedOccupiedVehicle(thePlayer)
  44.         destroyElement(journeyInt)
  45.         destroyElement(journeyBlip)
  46.         setElementFrozen(playerVehicle, false)
  47.         setVehicleEngineState(playerVehicle, true)
  48.                 outputChatBox("You destroyed your journey interior.", thePlayer, 250, 250, 0)
  49.         else
  50.                 outputChatBox("You need to be inside your joruney and inside a camping zone to use this command!", thePlayer, 250, 0, 0)
  51.     end
  52. end
  53. addCommandHandler("deletecamp", deleteCamp)