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)