FallingSheep
OpenDayZ Lord!
Antispam godmode in safezones
when you leave a safezone you must wait 2 minutes before godmode is reapplied
(all other safzone effects are still applied)
Requirements:
text editor (Notepad++)
open agn_SafeZoneCommander.sqf
just below this
add this
just below this
add this
ok now find this at the TOP and replace
with this
ok now find this at the BOTTOM and replace
with this
save file
now to the timer (So friggin simple once you know how to call them properly!)
create a new file called agn_timer.sqf and paste this into it
save it in MPmissions in your scripts folder
NOTE
(you can save it any where just make sure you change the path
Credits - AlienX (creator of AGN), HisShadowONE, MattL, SchwEde
when you leave a safezone you must wait 2 minutes before godmode is reapplied
(all other safzone effects are still applied)
Requirements:
text editor (Notepad++)
- Easy < 20
open agn_SafeZoneCommander.sqf
just below this
Code:
AGN_safeZone_Players_DisableWeaponFiring = true; //Should players not be able to shoot bullets/projectiles from their weapon(s)?
Code:
AGN_safeZoneAntispam = true; // puts a time limit on God mode when trying to leave and enter a safe zone rapidly
Code:
if ( AGN_safeZoneMessages ) then { systemChat ( "[AGN] Trader Zone Commander Loaded!" ); };
Code:
AGN_enteredSafezone = false; //default value
Code:
if ( AGN_safeZoneGodmode ) then{
CODE HERE
};
Code:
if ( AGN_safeZoneGodmode ) then{
//when player enters safezone
if (AGN_safeZoneAntispam )then{
if (AGN_enteredSafezone) then{
if ( AGN_safeZoneMessages ) then { systemChat ("[AGN] Antispam - Please wait before re-entering!"); };
}else{
AGN_enteredSafezone = true;//player has entered safezone
if ( AGN_safeZoneMessages ) then { systemChat ("[AGN] Entering Trader Area - God Mode Enabled"); };
if ( AGN_safeZoneMessages ) then { systemChat ("[AGN] Antispam - You must wait 2 minutes for god mode to become active once you leave!");};
player_zombieCheck = {};
fnc_usec_damageHandler = {};
_thePlayer removeAllEventHandlers "handleDamage";
_thePlayer addEventHandler ["handleDamage", {false}];
_thePlayer allowDamage false;
};
};
};
Code:
if ( AGN_safeZoneGodmode ) then{
CODE HERE
};
Code:
if ( AGN_safeZoneGodmode ) then{
//turn god mode off early just in case!
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";
_thePlayer addEventHandler ["handleDamage", {true}];
_thePlayer removeAllEventHandlers "handleDamage";
_thePlayer allowDamage true;
//check if anti spam is on
if (AGN_safeZoneAntispam )then{
//check if player has entered safezone recently
if (AGN_enteredSafezone) then{
[] execVM "scripts\agn_timer.sqf";
};
};
};
now to the timer (So friggin simple once you know how to call them properly!)
create a new file called agn_timer.sqf and paste this into it
Code:
//antispam timer
if ( AGN_safeZoneMessages ) then { systemChat ("[AGN] Antispam - You must wait 2 Minutes before godmode is reapplied!.");};
sleep 60;
if ( AGN_safeZoneMessages ) then { systemChat ("[AGN] Antispam - 1 minute remaining.");};
sleep 60;
AGN_enteredSafezone = false;
if ( AGN_safeZoneMessages ) then { systemChat ("[AGN] Antispam - You will now be protected when entering trader zones.");};
NOTE
(you can save it any where just make sure you change the path
Code:
[] execVM "YOUR_PATH_HERE\agn_timer.sqf";
Credits - AlienX (creator of AGN), HisShadowONE, MattL, SchwEde
Last edited: