GTA SA How do i activate the "securezone" script {HElp}

wuggybear

Member
Oct 6, 2012
50
0
I have problems working this script like what is a radar one and crap
Code:
--COPY ALL OF THIS BUT CHANGE, radar1, zone1, enterArea1, warp1, displayTimer1, (And sometimes the "function.addAccount")--
radar1 = createRadarArea(84, 1774,320,370,0,255,0, 100)
setElementData(radar1,"zombieProof",true)
Zone1 = createColRectangle (84, 1774,320,370)
 
addEventHandler("onColShapeHit", Zone1,
function(h)
    if not isElement(h) then return end
    if getElementData(h,"zombie") then killPed(h) end --These zones are also zombie proof
end)
 
function enterArea1(thePlayer)
    local posX, posY = getElementPosition(thePlayer)
    local inArea = isInsideRadarArea(radar1, posX, posY)
    if (inArea) then
          if hasObjectPermissionTo(thePlayer, "function.addAccount", false) then --Specify who can enter the zone
              primaryWeaponControl = isControlEnabled ( thePlayer, "fire" )
              if ( primaryWeaponControl == true ) then
                  toggleControl ( thePlayer, "fire", false ) -- change to true/false to allow/disallow shooting.
                  outputChatBox("***Safe Zone***", thePlayer, 0, 255, 0, true)
              end
          else
              triggerClientEvent(thePlayer, "displayTimer1", thePlayer)
          end
    end
end
addEventHandler("onColShapeHit", Zone1, enterArea1)
 
function warp1()
    local posX, posY = getElementPosition(source)
    local inArea = isInsideRadarArea(radar1, posX, posY)
    if (inArea) then
          if hasObjectPermissionTo(source, "function.addAccount", false) then --Specify who can enter the zone
              outputChatBox("***CHECKER*** You are allowed in this zone.", source, 0, 255, 0, true)
          else
              outputChatBox("You are not allowed in this area, Sorry...", source, 255, 0, 0, true)
              outputChatBox("You have been warped.", source, 255, 0, 0, true)       
                if isPedInVehicle ( source ) then
                local playerVehicle = getPedOccupiedVehicle ( source )
                    setElementPosition(playerVehicle, 2341.2072753906, -1658.8668212891, 13.379216194153)
                else
                    setElementPosition(source, 2341.2072753906, -1658.8668212891, 13.379216194153)
                end
          end
    end
end
addEvent("warp1", true)
addEventHandler("warp1", root, warp1)
---------------------------------------------------------------------------------------------------------------------------------------------
 

Users who are viewing this thread

Top