KoTaS Posted February 17, 2014 Report Share Posted February 17, 2014 dami_ZSHIELD = { if (isNil 'no_zombies_loop') then { while {true} do { if (!inSafeZone) exitWith {no_zombies_loop = nil;}; no_zombies_loop = true; _pos = getPos (vehicle player); _zombies = _pos nearEntities ["zZombie_Base",50]; {deletevehicle _x;} forEach _zombies; sleep 1; }; }; }; Is there a way to modify this code to delete DZAI and WAI @ SafeZones? Link to comment Share on other sites More sharing options...
0 TheVampire Posted February 17, 2014 Report Share Posted February 17, 2014 dami_ZSHIELD = { if (isNil 'no_zombies_loop') then { while {true} do { if (!inSafeZone) exitWith {no_zombies_loop = nil;}; no_zombies_loop = true; _pos = getPos (vehicle player); _zombies = _pos nearEntities ["zZombie_Base",50]; {deletevehicle _x;} forEach _zombies; sleep 1; }; }; }; Is there a way to modify this code to delete DZAI and WAI @ SafeZones? This code deletes zombies which have the specific zombie skins. AI share the same skins as players, so you can't delete them based on their skins. You might be able to check for all "Man" within so many meters, and if its not player delete it, but then it might delete the traders. Link to comment Share on other sites More sharing options...
0 KoTaS Posted February 17, 2014 Author Report Share Posted February 17, 2014 This code deletes zombies which have the specific zombie skins. AI share the same skins as players, so you can't delete them based on their skins. You might be able to check for all "Man" within so many meters, and if its not player delete it, but then it might delete the traders. Where can I found this script that deletes man within x meters? I give a try for it how its functions with traders Link to comment Share on other sites More sharing options...
0 icomrade Posted February 17, 2014 Report Share Posted February 17, 2014 You could try using something like this. dami_AISHIELD = { if (isNil 'no_ai_loop') then { while {true} do { if (!inSafeZone) exitWith {no_ai_loop = nil;}; no_ai_loop = true; _pos = getPosATL (vehicle player); _ai = _pos nearEntities ["Man",50]; {if ((!isPlayer _x) && (isAgent _x)) then {deletevehicle _x;};} forEach _ai; sleep 1; }; }; }; Note: I didn't want to recycle the variable used in another loop so it's no been renamed to no_ai_loop, same with the function name. Note/Edit: This may not work depending on whether or not your script creates the AI as agents. If it doesn't work remove "&& (isAgent _x)" from the condition Link to comment Share on other sites More sharing options...
0 Halvhjearne Posted February 17, 2014 Report Share Posted February 17, 2014 You could try using something like this. dami_AISHIELD = { if (isNil 'no_ai_loop') then { while {true} do { if (!inSafeZone) exitWith {no_ai_loop = nil;}; no_ai_loop = true; _pos = getPosATL (vehicle player); _ai = _pos nearEntities ["Man",50]; {if ((!isPlayer _x) && (isAgent _x)) then {deletevehicle _x;};} forEach _ai; sleep 1; }; }; }; Note: I didn't want to recycle the variable used in another loop so it's no been renamed to no_ai_loop, same with the function name. Note/Edit: This may not work depending on whether or not your script creates the AI as agents. If it doesn't work remove "&& (isAgent _x)" from the condition this might delete traders too ... i was playing around with this for a while and i did find a loop that could delete only ai ... however i found best way was to add this in the mphit event: dami_phit = { _attker = (_this select 1); _nAttkr = name _attker; if (_nAttkr != name player) then { _locATTK = mapGridPosition getPos _attker; // _attker setHit["Body",1];//commented out, since it dosnt affect local client _txt = ""+name player+" was shot by "+str _nAttkr+" in a safezone! The attacker is @ "+str _locATTK+"."; _sMSG = "SAFE-ZONE: "+str _txt+""; PVOZ_EPOCH_SAFEZONE = [_sMSG]; publicVariableServer "PVOZ_EPOCH_SAFEZONE"; _msg = "You were shot by "+str _nAttkr+""; systemChat (str _msg); if !(_attker in playableunits)then{deletevehicle _attker;systemChat "NPC was deleted!";}; }; }; (this is special code that only works with dami's safezone version btw unless variables are changed to fit) oh and as a bonus, this also deletes vehicles shooting in safezones Link to comment Share on other sites More sharing options...
0 KoTaS Posted February 17, 2014 Author Report Share Posted February 17, 2014 I'am going to give a try, do playableunits are DZAI and WAI? if !(_attker in playableunits)then{deletevehicle _attker;systemChat "NPC was deleted!";}; Link to comment Share on other sites More sharing options...
0 Halvhjearne Posted February 17, 2014 Report Share Posted February 17, 2014 its not deleting playable units, but anything else that hits someone in a safezone Link to comment Share on other sites More sharing options...
0 HisShadow Posted May 29, 2014 Report Share Posted May 29, 2014 anyone figure out how to delete dzai from safezones related topic http://opendayz.net/threads/in-search-of-anti-zombie-and-car-god-mode-at-trader-zones-using-agn.19479/page-4#post-102860 Link to comment Share on other sites More sharing options...
Question
KoTaS
Is there a way to modify this code to delete DZAI and WAI @ SafeZones?
Link to comment
Share on other sites
7 answers to this question
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