Trilon Posted October 13, 2015 Posted October 13, 2015 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)
Dealman Posted October 13, 2015 Posted October 13, 2015 You'll need to find the function that actually spawns the zombies to begin with.
Trilon Posted October 13, 2015 Author Posted October 13, 2015 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 )
Fist Posted October 13, 2015 Posted October 13, 2015 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.
Dealman Posted October 13, 2015 Posted October 13, 2015 No that is not helpful as it's how many zombies will spawn per player. I mean the actual function that spawns the zombies. Look for createPed.
Fist Posted October 19, 2015 Posted October 19, 2015 So how can i do that? you can check or zombie ped is in safezone, so if it is then kill ped.
jingzhi Posted October 20, 2015 Posted October 20, 2015 So how can i do that? Make the zombies cant enter AFK zones
Saml1er Posted October 20, 2015 Posted October 20, 2015 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)
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now