Jump to content
  • 0

Anti campers around traders cities


juandayz

Question

hey i was working on  anti camper script but i lost my server so cant test , and cant keep working on it  if anyone want to test or keep this work i give the codes where i left.

first create this path:  mpmissions\instance 11...\nokill\

nokillarea.sqf

Spoiler

titleText ["YOURE IN A RESTRICTED AREA,DO NOT KILL OR U WILL PUNISHED", "PLAIN DOWN"];titleFadeOut 5;

if (isNil "safearea") then {
    safearea = true;
};

while {!safearea} do {
_characterID =     _this select 0;
_minutes =        _this select 1;
_newObject =     _this select 2;
_playerID =     _this select 3;
_infected =        _this select 4;
if (((count _this) >= 6) && {(typeName (_this select 5)) == "STRING"} && {(_this select 5) != ""}) then {
    _victimName =    _this select 5;
} else {
    _victimName =  if (alive _newObject) then {name _newObject;} else {"";};
};
_victim = _newObject;
_newObject setVariable ["bodyName", _victimName, true];
_newObject setVariable ["bodyUID", _playerID, true];

_killer = _victim getVariable["AttackedBy", "nil"];
_killerName = _victim getVariable["AttackedByName", "nil"];

 

if ((side _killer) == EAST) exitwith {
};

if ((side _killer) == WEST) then {
    sleep 1;
   [_killer] execVM "nokill\punish.sqf"

//[_killer] endMission "LOSER"; //return to lobby //same as execute punish.sqf
} else {
   if (((count crew _killer) > 1) && ((side _killer) == WEST)) then {
     if (((gunner _killer) in (crew _killer)) && ((side _killer) == WEST)) then {
        sleep 1;
       [(gunner _killer)] execVM "nokill\punish.sqf"

//[(gunner _killer)] endMission "LOSER"; //return to lobby
     } else {
        sleep 1;
       [(driver _killer)] "nokill\punish.sqf"


     };
   } else {
        sleep 1;
        [(driver _killer)] execVM "nokill\punish.sqf"

//[(driver _killer)] endMission "LOSER"; //return to lobby
   };
};
};

punish.sqf

Spoiler

titleText ["YOURE WILL BE KICKED CAMPER", "PLAIN DOWN"];titleFadeOut 5;

sleep 2;

endMission "LOSER"; //return to lobby

*Now in mission.sqm needs create a new class sensor this is only for test 600mts around Stary

Spoiler

class Item8 //modify eight by your number
        {
            position[]={6325.6772,304.99033,7807.7412};
            a=600;
            b=600;
            activationBy="WEST";
            repeating=1;
            interruptable=1;
            age="UNKNOWN";
            name="safearea";
            expCond="(vehicle player) in thislist;";
            expActiv="safearea = false; nokillarea = [] execVM ""nokill\nokillarea.sqf"";";
            expDesactiv="safearea = true; terminate nokillarea;  titleText [""\n\nLeaving NoKillArea"", ""PLAIN DOWN"", 3];";            
            class Effects
            {
            };
        };

 

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

  • 0
18 hours ago, juandayz said:

hey i was working on  anti camper script but i lost my server so cant test , and cant keep working on it  if anyone want to test or keep this work i give the codes where i left.

first create this path:  mpmissions\instance 11...\nokill\

nokillarea.sqf

  Reveal hidden contents

titleText ["YOURE IN A RESTRICTED AREA,DO NOT KILL OR U WILL PUNISHED", "PLAIN DOWN"];titleFadeOut 5;

if (isNil "safearea") then {
    safearea = true;
};

while {!safearea} do {
_characterID =     _this select 0;
_minutes =        _this select 1;
_newObject =     _this select 2;
_playerID =     _this select 3;
_infected =        _this select 4;
if (((count _this) >= 6) && {(typeName (_this select 5)) == "STRING"} && {(_this select 5) != ""}) then {
    _victimName =    _this select 5;
} else {
    _victimName =  if (alive _newObject) then {name _newObject;} else {"";};
};
_victim = _newObject;
_newObject setVariable ["bodyName", _victimName, true];
_newObject setVariable ["bodyUID", _playerID, true];

_killer = _victim getVariable["AttackedBy", "nil"];
_killerName = _victim getVariable["AttackedByName", "nil"];

 

if ((side _killer) == EAST) exitwith {
};

if ((side _killer) == WEST) then {
    sleep 1;
   [_killer] execVM "nokill\punish.sqf"

//[_killer] endMission "LOSER"; //return to lobby //same as execute punish.sqf
} else {
   if (((count crew _killer) > 1) && ((side _killer) == WEST)) then {
     if (((gunner _killer) in (crew _killer)) && ((side _killer) == WEST)) then {
        sleep 1;
       [(gunner _killer)] execVM "nokill\punish.sqf"

//[(gunner _killer)] endMission "LOSER"; //return to lobby
     } else {
        sleep 1;
       [(driver _killer)] "nokill\punish.sqf"


     };
   } else {
        sleep 1;
        [(driver _killer)] execVM "nokill\punish.sqf"

//[(driver _killer)] endMission "LOSER"; //return to lobby
   };
};
};

punish.sqf

  Reveal hidden contents

titleText ["YOURE WILL BE KICKED CAMPER", "PLAIN DOWN"];titleFadeOut 5;

sleep 2;

endMission "LOSER"; //return to lobby

*Now in mission.sqm needs create a new class sensor this is only for test 600mts around Stary

  Reveal hidden contents

class Item8 //modify eight by your number
        {
            position[]={6325.6772,304.99033,7807.7412};
            a=600;
            b=600;
            activationBy="WEST";
            repeating=1;
            interruptable=1;
            age="UNKNOWN";
            name="safearea";
            expCond="(vehicle player) in thislist;";
            expActiv="safearea = false; nokillarea = [] execVM ""nokill\nokillarea.sqf"";";
            expDesactiv="safearea = true; terminate nokillarea;  titleText [""\n\nLeaving NoKillArea"", ""PLAIN DOWN"", 3];";            
            class Effects
            {
            };
        };

 

@juandayz If you need a server to test on, let me know. You can use one of mine or we can set one up on your PC.

Link to comment
Share on other sites

  • 0
On 9/9/2016 at 3:52 PM, lwbuk said:

It appears so, yes. I did play around with it, didn't get any further. Shame as it would be a really useful script. 

try it. unpack your dayz_server.pbo.

at very bottom of server_playerDied.sqf   paste:

Spoiler

 _nokill = false;

safezonepos = [[6325.6772,7807.7412,0],[11447.472,11364.504,0],[1606.6443,7803.5156,0],[12944.227,12766.889,0],[12060,12640,0]];

restrict = 500;

{

if ((player distance _x) < restrict) then {

_nokill = true;

};

} foreach safezonepos;

if (_nokill) then {

if ((side _killer) == EAST) exitwith {
};

if ((side _killer) == WEST) then {
    sleep 1;
   [_killer] execVM "nokill\punish.sqf"
} else {
   if (((count crew _killer) > 1) && ((side _killer) == WEST)) then {
     if (((gunner _killer) in (crew _killer)) && ((side _killer) == WEST)) then {
        sleep 1;
       [(gunner _killer)] execVM "nokill\punish.sqf"
     } else {
        sleep 1;
       [(driver _killer)] "nokill\punish.sqf"
     };
   } else {
        sleep 1;
        [(driver _killer)] execVM "nokill\punish.sqf"
   };
};
};

repack your pbo

punish.sqf   (mpmissions\instance_11.chernarus\nokill\ )

Spoiler

titleText ["YOURE WILL BE KICKED CAMPER", "PLAIN DOWN"];titleFadeOut 5;

sleep 2;

endMission "LOSER"; //return to lobby

 

Link to comment
Share on other sites

  • 0
7 hours ago, syco said:

They will just use this to dupe. Getting kicked to the lobby is not a punishment anyways. lol wtf are you guys thinking.

You are making this much harder then it needs to be.

can be setdamage 1; or whatever do you think,,

for example punish.sqf:

 

titleText ["YOURE WILL BE KICKED CAMPER", "PLAIN DOWN"];titleFadeOut 5;

sleep 2;

//endMission "LOSER"; //return to lobby
player SetDamage 1;
removeAllWeapons player;
removeBackpack player;
{player removeMagazine _x} forEach magazines player;

Link to comment
Share on other sites

  • 0

I wasn't intending on having kick to lobby. I was setting it up to auto kill, as above..

Instead of posting stupid crap like that, how about adding something to actually help...

On 16 September 2016 at 7:28 AM, syco said:

They will just use this to dupe. Getting kicked to the lobby is not a punishment anyways. lol wtf are you guys thinking.

You are making this much harder then it needs to be.

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Discord

×
×
  • Create New...