Jump to content

Help with a script


Mike269

Recommended Posts

is there any good anti zombie zone script? I really do need something strong.

btw I am using this and I need help in this zone only a player with skin 29 survives but how can I add more skins to be able to survive here

safecol = createColCuboid ( 2442.2404785156, -1721.3907470703, 13.775855064392, 150, 150, 150 )
safeZoneRadar = createRadarArea ( 2442.2404785156, -1721.3907470703, 150, 150, 56, 4, 109 )
setElementData (safeZoneRadar, "zombieProof", true) 

function enterZone(hitPlayer,thePlayer)
local skin = getElementModel (hitPlayer)
      if ( skin == 29) then


    outputChatBox("You are entering a safe zone.", hitPlayer, 0, 255, 0)
       else
         killPed (hitPlayer)
end
end
addEventHandler( "onColShapeHit", safecol, enterZone )

function leaveZone(hitPlayer,thePlayer)
local skin = getElementModel (hitPlayer)
  
    outputChatBox("You are leaving a safe zone!", hitPlayer, 255, 0, 0)
 if not ( skin == 29)  then
  killPed (hitPlayer)
end
end
addEventHandler( "onColShapeLeave", safecol, leaveZone )

Edited by Mike269
Link to comment

Dear Mike269,

please format your code using the "<>" button so that it is not difficult to read.

If the list of skins is known beforehand, then you can create a table with all the skins (29, etc) and use getElementModel to check each player or ped that entered against entries in said table.

local safe_ped_skins = {
  [29] = true
  -- add more entries here
}

 

Edited by The_GTA
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...