[Snippet] Always combat zone

zipcore

New Member
I did this long time ago for a friend, but I like to release it now. Iwill not make your weapon sybol blinking but you can't logout etc.

mission.sqm -
Code:
combatzone = false;

mission.sqm -
Code:
        class Item3
        {
            position[]={2600,304.99023,4760}; //coordinates for the center of of your zone
            activationBy="WEST";
            repeating=1;
            interruptable=1;
            age="UNKNOWN";
            name="combatzone";
            expCond="(player distance combatzone) < 100;"; //radius of your zone
            expActiv="combatzone = true;";
            expDesactiv="combatzone = false;";
            class Effects
            {
            };
        };

combatzone.sqf
Code:
while {combatzone} do {
    player setVariable["combattimeout", time + 20, true]; //how long to extend combat timeout? default 20s
    sleep 1; //check delay defaut 1s
};

combatzone.sqf
Code:
[] execVM "PATHTOYOUR\combatzone.sqf";


You can also chane

expActiv="combatzone = true;";
expDesactiv="combatzone = false;";

to

expActiv="combatzone = false;";
expDesactiv="combatzone = true;";

and set coords at middle of the map to set players in combat mode when they leave battlefield :D
 
Rewritten to save resources:

mission.sqm

Code:
class Item3
        {
            position[]={2600,304.99023,4760}; //coordinates for the center of of your zone
            activationBy="WEST";
            repeating=1;
            interruptable=1;
            age="UNKNOWN";
            name="combatzone";
            expCond="(player distance combatzone) < 100;"; //radius of your zone
            expActiv="player setVariable['startcombattimer', 1, true];";
            expDesactiv="player setVariable['startcombattimer', 0, true];";
            class Effects
            {
            };
        };

No need for the while loop and no need for initialising the combattimer variable.
This works of the player_spawn2.sqf file native to dayz.
 
Back
Top