--[[local campLocations =
{
{X=1494, Y=-2171, Z=13},
}
for _, camp in pairs(campLocations) do
campM = createMarker(camp.X, camp.Y, camp.Z-1, "cylinder", 2, 250, 250, 0)
campCol = createColRectangle(camp.X-20, camp.Y-20, 70, 70)
end]]
function detectMarkerHit(hitPlayer)
outputChatBox("LOL")
end
addEventHandler("onMarkerHit", root, detectMarkerHit)
addEvent("playerBuyCampSpot", true)
function playerBoughtSpot()
local campCost = 2500
local playerMoney = getPlayerMoney(source)
if (playerMoney > campCost and getPlayerWantedLevel(source) == 0) then
outputChatBox("You have bought a camping spot for $2500", source, 0, 250, 0)
else
outputChatBox("You need to have atleast $2500 and no more than 0 wanted stars!", source, 250, 0, 0)
end
end
addEventHandler("playerBuyCampSpot", root, playerBoughtSpot)
function enterCampInt(thePlayer)
if (isPedInVehicle(thePlayer) and not isElement(journeyInt) and getElementData(thePlayer, "campData") == "Avaliable") then
local playerVehicle = getPedOccupiedVehicle(thePlayer)
local vX, vY, vZ = getElementPosition(playerVehicle)
journeyInt = createMarker(0, 0, 0, "arrow", 2, 250, 250, 0)
journeyBlip = createBlipAttachedTo(playerVehicle, 32)
attachElements(journeyInt, playerVehicle, 2, 0.2, 1)
setElementFrozen(playerVehicle, true)
setVehicleEngineState(playerVehicle, false)
end
end
addCommandHandler("camp", enterCampInt)
function deleteCamp(thePlayer)
if (isPedInVehicle(thePlayer) and isElement(journeyInt)) then
local playerVehicle = getPedOccupiedVehicle(thePlayer)
destroyElement(journeyInt)
destroyElement(journeyBlip)
setElementFrozen(playerVehicle, false)
setVehicleEngineState(playerVehicle, true)
outputChatBox("You destroyed your journey interior.", thePlayer, 250, 250, 0)
else
outputChatBox("You need to be inside your joruney and inside a camping zone to use this command!", thePlayer, 250, 0, 0)
end
end
addCommandHandler("deletecamp", deleteCamp)