Trilon Posted October 13, 2015 Share 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) Link to comment
Dealman Posted October 13, 2015 Share Posted October 13, 2015 You'll need to find the function that actually spawns the zombies to begin with. Link to comment
Trilon Posted October 13, 2015 Author Share 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 ) Link to comment
Fist Posted October 13, 2015 Share 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. Link to comment
Dealman Posted October 13, 2015 Share 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. Link to comment
Trilon Posted October 18, 2015 Author Share Posted October 18, 2015 So how can i do that? Link to comment
Fist Posted October 19, 2015 Share 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. Link to comment
jingzhi Posted October 20, 2015 Share Posted October 20, 2015 So how can i do that? Make the zombies cant enter AFK zones Link to comment
Saml1er Posted October 20, 2015 Share 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) Link to comment
[PXG]Blue Posted October 21, 2015 Share Posted October 21, 2015 cough You might wanna check that out Link to comment
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