Jump to content

Bad argument


Drakath

Recommended Posts

radar = createRadarArea(2418.4255371094, -1735,121.6306152344,100,0,150,0,153) 
setElementData(radar,"zombieProof",true) 
staffZone = createColRectangle (2418.4255371094, -1735,121.6306152344,100) 
  
addEventHandler("onColShapeHit", staffZone, 
function(h) 
    if not isElement(h) then return end 
    if getElementData(h,"zombie") then killPed(h) end 
end) 
  
function enterArea(thePlayer) 
     local posX, posY = getElementPosition(thePlayer) 
     local inArea = isInsideRadarArea(radar, posX, posY) 
     if (inArea) then 
          if hasObjectPermissionTo(thePlayer, "command.slap", false) then 
               outputChatBox("Welcome to the Staff Zone", thePlayer, 0, 255, 0, true) 
          else 
               triggerClientEvent(thePlayer, "displayTimer", thePlayer) 
          end 
     end 
end 
addEventHandler("onColShapeHit", staffZone, enterArea) 
  
function warp() 
     local posX, posY = getElementPosition(source) 
     local inArea = isInsideRadarArea(radar, posX, posY) 
     if (inArea) then 
          if hasObjectPermissionTo(source, "command.slap", false) then 
               outputChatBox("Welcome to the Staff Zone", source, 0, 255, 0, true) 
          else 
               outputChatBox("You are not allowed in this area!", 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("warp", true) 
addEventHandler("warp", root, warp) 

Link to comment

This only happens when you enter with a vehicle as well, right?

Edit: You can use this:

radar = createRadarArea(2418.4255371094, -1735,121.6306152344,100,0,150,0,153) 
setElementData(radar,"zombieProof",true) 
staffZone = createColRectangle (2418.4255371094, -1735,121.6306152344,100) 
  
addEventHandler("onColShapeHit", staffZone, 
function(h) 
    if not isElement(h) then return end 
    if getElementData(h,"zombie") then killPed(h) end 
end) 
  
function enterArea(thePlayer) 
    if ( getElementType ( thePlayer ) == "player" ) then 
        local posX, posY = getElementPosition(thePlayer) 
        local inArea = isInsideRadarArea(radar, posX, posY) 
        if (inArea) then 
            if hasObjectPermissionTo(thePlayer, "command.slap", false) then 
                outputChatBox("Welcome to the Staff Zone", thePlayer, 0, 255, 0, true) 
            else 
                triggerClientEvent(thePlayer, "displayTimer", thePlayer) 
            end 
        end 
    end 
end 
addEventHandler("onColShapeHit", staffZone, enterArea) 
  
function warp() 
     local posX, posY = getElementPosition(source) 
     local inArea = isInsideRadarArea(radar, posX, posY) 
     if (inArea) then 
          if hasObjectPermissionTo(source, "command.slap", false) then 
               outputChatBox("Welcome to the Staff Zone", source, 0, 255, 0, true) 
          else 
               outputChatBox("You are not allowed in this area!", 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("warp", true) 
addEventHandler("warp", root, warp) 

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...