try this one
EDIT : i added if the player leaves the colshape didn't get killed after 5 secondes
safeZone = createColRectangle ( 1837.4000244141, 1283.0999755859, 195, 165)
safeArea = createRadarArea ( 1837.4000244141, 1283.0999755859, 195, 165, 0, 255, 0, 150)
function killP(hitElement)
if (getElementType(hitElement)=="ped") then
destroyElement(hitElement)
elseif (getElementType(hitElement)=="player") then
local playerTeam = getPlayerTeam ( hitElement )
local teamName = ( playerTeam and getTeamName ( playerTeam ) or "" )
if not ( teamName == "LV MAFIA")then
outputChatBox("You're not part of LV MAFIA Clan You'll be killed after 5 secondes", hitElement)
timer = setTimer(function()
killPed(hitElement)
end,5000,1)
end
end
end
addEventHandler("onColShapeHit", safeZone, killP)
function stopKillP(hitElement)
if (getElementType(hitElement) == "player") then
if isTimer(timer) then killTimer(timer) end
end
end
addEventHandler("onColShapeLeave",safeZone,stopKillP)