Hey I am using this safezone script and it works great
However (please bare with me) I added a small edit to it, which kills the player outside the safezone that kills or even hits a fresh spawn player inside the safezone (safezone is the spawn area for our servers).
The problem is the following.
1- I spawn in fine with Godmode and cannot shoot my weapon while inside the safezone.
Or I enter the safezone and get godmode and can't shoot, just like it should.
2- I exit the spawn area (safezone) and as soon as I kill a player, I also get killed even if I am away from the safezone.
Seems that my script here is a little broken for sure, as it's only suppose to kill the player (outside the safezone) that shoots another player INSIDE the safezone. Now i always get AUTO killed no matter what, I should be able to kill any player while outside the safezone, just as long as I don't shoot a person that's inside the safezone. For now I am forced to spawn in, run away from safezone, logout, and come back in the game to be safe to kill another player while both of us are way outside the safezone. PLEASE ask if you need more clarification.
HERE IS THE SCRIPT - PLEASE HELP
The problem is the following.
1- I spawn in fine with Godmode and cannot shoot my weapon while inside the safezone.
Or I enter the safezone and get godmode and can't shoot, just like it should.
2- I exit the spawn area (safezone) and as soon as I kill a player, I also get killed even if I am away from the safezone.
Seems that my script here is a little broken for sure, as it's only suppose to kill the player (outside the safezone) that shoots another player INSIDE the safezone. Now i always get AUTO killed no matter what, I should be able to kill any player while outside the safezone, just as long as I don't shoot a person that's inside the safezone. For now I am forced to spawn in, run away from safezone, logout, and come back in the game to be safe to kill another player while both of us are way outside the safezone. PLEASE ask if you need more clarification.
HERE IS THE SCRIPT - PLEASE HELP
Code:
Private ["_EH_Fired"];
if (isNil "inSafezone") then {
inSafezone = false;
};
while {true} do {
waitUntil { inSafeZone };
titleText [format["YOU'RE NOW IN THE SPAWN AREA. DEACTIVATING WEAPONS."],"PLAIN DOWN"]; titleFadeOut 4;
waitUntil { player == vehicle player };
thePlayer = vehicle player;
_EH_Fired = thePlayer addEventHandler ["Fired", {
titleText ["YOU CANNOT FIRE YOUR WEAPON IN THE SPAWN AREA","PLAIN DOWN"]; titleFadeOut 4;
NearestObject [_this select 0,_this select 4] setPos[0,0,0];
_EH_Hit = thePlayer addEventHandler ["Hit", {_this select 1 setdammage 1; player setDammage 0; vehicle player setDammage 0}];
_EH_Killed = thePlayer addEventHandler ["Killed",{_this select 1 setdammage 1}];
}];
player_zombieCheck = {};
fnc_usec_damageHandler = {};
fnc_usec_unconscious = {};
thePlayer removeAllEventHandlers "handleDamage";
thePlayer addEventHandler ["handleDamage", {false}];
thePlayer allowDamage false;
waitUntil { !inSafeZone };
titleText [format["EXITING SPAWN AREA. WEAPONS RE-ACTIVATED"],"PLAIN DOWN"]; titleFadeOut 4;
thePlayer removeEventHandler ["Fired", _EH_Fired];
thePlayer removeEventHandler ["Hit", _EH_Hit];
thePlayer removeEventHandler ["Killed",_EH_Killed];
player_zombieCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieCheck.sqf";
fnc_usec_damageHandler = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandler.sqf";
fnc_usec_unconscious = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_unconscious.sqf";
thePlayer addEventHandler ["handleDamage", {true}];
thePlayer removeAllEventHandlers "handleDamage";
thePlayer allowDamage true;
};