Jump to content

Zombie in safezone


Trilon

Recommended Posts

How can i do in DayZ server the zombies didn't spawn in the safezone and the peoples didn't lose blood if he/she entered to this zone but if she left he/she can lose hp, i paste the safezone script:

local r,g,b = 50, 150, 50 
local alpha = 155 
local GreenZone = createColRectangle ( 2857.49,-1320.74,315,433)   
local Radar = createRadarArea ( 2857.49,-1320.74,315,433,r, g, b, alpha)   
  
addEventHandler ( "onColShapeHit", GreenZone, 
function  (thePlayer,matchingDimension ) 
      if matchingDimension and isElement(thePlayer) and getElementType(thePlayer) == "player" then 
         toggleControl ( thePlayer, "fire", false ) 
         toggleControl ( thePlayer, "next_weapon", false ) 
         toggleControl ( thePlayer, "previous_weapon", false ) 
         outputChatBox( "Biztonsági zóna: Beléptél a biztonsági zónába itt nem lőhetsz.",thePlayer, r,g,b) 
   end 
end) 
  
addEventHandler ( "onColShapeLeave", GreenZone, 
function ( thePlayer, matchingDimension ) 
        if matchingDimension and isElement(thePlayer) and getElementType(thePlayer) == "player" then 
         toggleControl ( thePlayer, "fire", true ) 
         toggleControl ( thePlayer, "next_weapon", true ) 
         toggleControl ( thePlayer, "previous_weapon", true ) 
       outputChatBox ( "Biztonsági zóna Kiléptél a biztonsági zónából.Vigyázz magadra!",thePlayer,255,0,0) 
     end 
end) 

Link to comment
I find this :

gameplayVariables["playerzombies"] = 6 -- Amount of spawning zombies per player - DEFAULT: 6 - THE HIGHER THIS VALUE, THE MORE LAG CAN OCCUR!

So i must write?

setelementdata( thePlayer, "playerzombies", 0 ) 

first of all, Lua is upper case sensivite langueage. If you dont write excalty how it should be it wont work. Like you wrote "setelementdata" it will not work, cause it should look like this "setElementData". And second, tables dont work like that, if table is edited like this "gameplayVariables["playerzombies"] = 6" it should be edited that same like this "gameplayVariables["playerzombies"] = 0".

And yes you could try do that, or find actual function that spawns zombies and rewrite it a bit, so it tells if player is in safezone, then dont spawn those damn zombies.

Also im sorry if i made some mistakes in writing, cause im not as good in english.

Link to comment
  
addEventHandler ( "onColShapeHit", GreenZone, 
function  (thePlayer,matchingDimension ) 
      if matchingDimension and isElement(thePlayer) then  
          if getElementType(thePlayer) == "player" then 
               toggleControl ( thePlayer, "fire", false ) 
               toggleControl ( thePlayer, "next_weapon", false ) 
               toggleControl ( thePlayer, "previous_weapon", false ) 
             outputChatBox( "Biztonsági zóna: Beléptél a biztonsági zónába itt nem lőhetsz.",thePlayer, r,g,b) 
             
                  elseif getElementType(thePlayer) == "ped"  and getElementData(thePlayer, "zombie") then  
                      
                      destroyElement( thePlayer ) -- destroy the ped since you don't want zombies in safe zone 
          end  
     end 
end) 
  

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