Base protection help

Aiden123

New Member
Hi, I want to add base protection domes onto my server as many of the custom bases are being raided during the night which is making the owners very angry. However I don't want the full dome protection, i would like the dome to only be activated when the owner of the base is offline and would be deactivated when they came back online is this possible and if so, how would i go about doing this?
Thanks for your help.
 
I think you'd have to modify the server side code. You could use onPlayerConnected and onPlayerDisconnected to set the value of an effective public variable, rebroadcasting it whenever it was changed with publicVariable. The client trigger-based script would then branch according to the value of the broadcast value, so you could activate your shield upon intrusion, or not.
 
Thanks for the reply but my scripting knowledge is extremely basic to non existent. Closest I've got to scripting is following tutorials haha. Hopefully someone will post a full tutorial for me but if not i may have to brave it and jump into doing it myself.
 
If someone has something like this already working, i would really appreciate it if they could share the script with me :)
 
Hey, in the dayz_server.pbo file (for DayZ.st) in the compile folder, there are two files called server_onPlayerConnect.sqf and server_onPlayerDisconnect.sqf. The former is blank, but clearly represents code to be called automatically on player log-in. I didn't know for sure how to implement the server-side for what you need, but I'll bet that's it, ready to add script.
 

In the online check file it should be as easy as changing
Code:
online_check_k = false;
    _countthem = (({isplayer _x} count (getPos vehicle player nearObjects ['CAManBase',90000])));
    _countthem2 = (getPosATL player) nearObjects ["CAManBase", 90000];
    {
        if (isPlayer _x) then
        {
            if (getPlayerUID _x in _basePUIDs) then
            {
                counted_players = counted_players + 100;
            };
            counted_players= counted_players + 1;
        };
    } forEach _countthem2;
    if (counted_players > _countthem) then
    {
        online_check_k = true;
    };
    if (online_check_k) exitWith {};
to
Code:
    online_check_k = true;
    _countthem = (({isplayer _x} count (getPos vehicle player nearObjects ['CAManBase',90000])));
    _countthem2 = (getPosATL player) nearObjects ["CAManBase", 90000];
    {
        if (isPlayer _x) then
        {
            if (getPlayerUID _x in _basePUIDs) then
            {
                counted_players = counted_players + 100;
            };
            counted_players= counted_players + 1;
        };
    } forEach _countthem2;
    if (counted_players > _countthem) then
    {
        online_check_k = false;
    };
    if (online_check_k) exitWith {};

But i'm not sure if that'll work. In theory it will xD
 
Back
Top