Epoch1061 logout punishment Script Help

Discussion in 'Scripting Discussions' started by Goose QZ, Dec 11, 2017.

  1. Goose QZ

    Goose QZ New Member

    Joined:
    Dec 11, 2017
    Messages:
    11
    Likes Received:
    0
    Hi, ive been playing Arma 2 (Dayz Epoch) for about 1200 hours now, and recently i have started to develop a server for Epoch 1061. The server is near completion and is only missing a few small scripts and some touchups here and there.
    One script that I need to add is giving me a hard time...
    On the server i have a custom Skalisty Island mission in which AI,M2's, etc spawn, loot crates are on the island etc.
    Now, i dont want players to be able to log off on Skalisty island. I know i cant stop people from Alt-F4ing on it, so my plan is to deter/punish them for doing so.
    The only script i could adapt/find was one that forced playes to spawn somewhere else when they logged into the server in an area where they "arent allowed" to log out , but this script requires me to add every single 6 figure grid co-ord manually into the script.

    Since i would like to punish people for logging out in othet areas too,i was hoping if someone could provide a smaller script for this. I can adapt it to the desired punishment. All i would like is a script that punishes a player for logging out within a certain distance (or radius) etc from a set point.
    My psuedocode explaination is:
    If (player IN zone) then
    *relevant punishment*
    With "player" being the player and "zone" being the area/radius in which the player isnt allowed to log out in

    Sorry for the long winded request,
    Regards, Gooooose
     
  2. Inkko

    Inkko Valued Member!

    Joined:
    Jan 12, 2013
    Messages:
    719
    Likes Received:
    94
    a simple way to do it could be something like this added at the bottom of init.sqf

    Code:
    PunishmentZone = [13590, 12266, 0]; // zone center location
    PunishmentRadius = 1000; // radius of zone
    [] spawn {
        if (isServer) exitwith {};
        waituntil {speed player > 1}; // I always add this, pretty much to make sure they've loaded in all the way.(could exploit by standing still)
        if (player distance PunishmentZone < PunishmentRadius) then {
            /* insert punishment code here */
        };
    };
    

    Code:
    PunishmentZones = [[13338, 12501, 0],[13659, 12454, 0],[13990, 12454, 0]]; // mini zone center location
    PunishmentRadius = 500; // radius of zone
    [] spawn {
        if (isServer) exitwith {};
        waituntil {speed player > 1}; // I always add this, pretty much to make sure they've loaded in all the way. (could exploit by standing still)
        {
            if (player distance _x < PunishmentRadius) then {
                /* insert punishment code here */
            };
        } foreach PunishmentZones;
    };
    

    There are ways to do it in the mission.sqm as well with trigger zones but this is what I came up with. I personally would probably use this code to handle the punishment and use the mission.sqm to have a trigger to warn of punishment for logging out in the area.
     
  3. Goose QZ

    Goose QZ New Member

    Joined:
    Dec 11, 2017
    Messages:
    11
    Likes Received:
    0

    Aha just what i was looking for. Ill will test this when im back at my setup tomorrow and ill get back to you. Thanks a bunch :)
     
  4. Inkko

    Inkko Valued Member!

    Joined:
    Jan 12, 2013
    Messages:
    719
    Likes Received:
    94
    You may have to adjust the coordinates tho, I didn't launch the game to get the exact coordinates.
     

Share This Page