Editing epoch scripts

Hey guys,

I have a few scripts/issues i would like to get help with so i'll keep update this thread with DayZ epoch changes/additions that i get help with for everyone to use.

Lock/Unlock vehicle (For Admins)​
I was looking over the script to lock/unlock vehicles in DayZ Epoch and i was thinking if i could get some help to make a "check" for certain UID's that are able to unlock any vehicle such as an admin who is wanting to move a vehicle.

READ POST #3 and #4. doppelganger and maca134 have released 2 scripts that will both work in adding a lock/unlock for admins.

Adding Master keys​
Is it possible to add master keys for every vehicle? Epoch may add a key ring in the future but the mass amounts of keys i have im looking for a solution to get rid or not need as much. Maybe admins can have a new key made up that can unlock all vehicles or a key for each use such as a Red key might do ground vehicles while a black key might do air vehicles.

Spawning AI (not Sarge AI.)​
Anyone been able to spawn in AI via admin tools or player made recipe so people can create AI for having them pilot or drive them around the map? I know 1 server that has it but it doesnt last through restart and i don't have the script for it so a solution or help to adding it for everyone's use here would be very beneficial.​
Editing Player Knockout​
Editing player2's knockout so its not able to be used in trader cities would be a very needed script for anyone running the knockout script on epoch servers. At the moment if you have the knockout script on your epoch server and someone knocks you out in a trader city you cannot get up and are glitched knocked out permanently or useless you use a bandage or someone using an epi pen.

Editing Admin tools for epoch​
The second thing i was after was making changes to my Admin tools to add scripts to spawn epoch related items/vehicles, possibly even opening a text box where we can enter a class name for a vehicle and it spawns it, or a weapon class name to spawn it. I've been in servers where people can also pick up vehicles with their player and walk it away from somewhere and then drop it which would be useful for vehicles placed or left on the spawn pad in a trader city (same way as wasteland).

If this is in the wrong section then sorry please move it, this is a mix of a bunch of stuff and i didnt want to spam the forum or have alot of threads about nearly the same issues. other than that I think we need a epoch thread about adding specific scripts just for epoch.

Thanks,
blacksheep25
 
This would also be incredibly handy on my small PVE server. So many people lose keys to their vehicles, or for some reason the key stops working, that it's almost a full time job having to get that locked vehicle out of the way somehow (usually by satchel charge) and then replacing the vehicle for the player in question.

If we could get a master admin key, that would be a potential temporary solution, till the next restart and the vehicle is locked once more. Ideally for my particular server, we don't actually NEED keys because we all know each other in RL. Is there a way to make the purchased vehicle simply spawn like a fully repaired random spawn, instead? No key needed?
 
Hey all, First post since I've joined the forums, I figured maybe I could answer this or attempt. I have never written any code for arma or dayz but I do have a good understanding of other languages such as PHP, PERL, jingjing(hybrid language of vb and c#) and I thought maybe this might work.

Code:
//Enter admins PlaerUID
_dayz_admin = 1234567890;
 
if (_dayz_admin == dayz_playerUID) then {
_admin = dayz_playerUID;
};
 
    // Allow Owner to lock and unlock vehicle
    if(_isVehicle and _isAlive and !_isMan and _ownerID != "0") then {
        if (s_player_lockUnlock_crtl < 0) then {
            _hasKey = _ownerID in _temp_keys;
            _oldOwner = (_ownerID == dayz_playerUID);
            if(locked _cursorTarget) then {
                if(_hasKey or _oldOwner or _admin) then {
                    _Unlock = player addAction [format["Unlock %1",_text], "\z\addons\dayz_code\actions\unlock_veh.sqf",_cursorTarget, 2, true, true, "", ""];
                    s_player_lockunlock set [count s_player_lockunlock,_Unlock];
                    s_player_lockUnlock_crtl = 1;
                } else {
                    _Unlock = player addAction ["<t color='#ff0000'>Vehicle Locked</t>", "",_cursorTarget, 2, true, true, "", ""];
                    s_player_lockunlock set [count s_player_lockunlock,_Unlock];
                    s_player_lockUnlock_crtl = 1;
                };
            } else {
                if(_hasKey or _oldOwner or _admin) then {
                    _lock = player addAction [format["Lock %1",_text], "\z\addons\dayz_code\actions\lock_veh.sqf",_cursorTarget, 1, true, true, "", ""];
                    s_player_lockunlock set [count s_player_lockunlock,_lock];
                    s_player_lockUnlock_crtl = 1;
                };
            };
        };
   
    } else {
        {player removeAction _x} forEach s_player_lockunlock;s_player_lockunlock = [];
        s_player_lockUnlock_crtl = -1;
    };

Or if you want to look into making an array list of admins, I found this guide which could put you in the right direction so it would work for multiple people.

http://forums.bistudio.com/showthread.php?100559-Beginners-guide-Arrays

Please note, I have no idea if the above code works, but would like to hear if it did. Since i dont have any experience in this language yet, i thought id take a stab at it.
 
Dopple, pretty much what i have

I have my admin uid's defined in init.sqf
Code:
adminList = ["00000", "000000"];

And I have overidden selfActions

Code:
// Allow Owner to lock and unlock vehicle  
if(_isVehicle and _isAlive and !_isMan and _ownerID != "0") then {
    if (s_player_lockUnlock_crtl < 0) then {
        _hasKey = _ownerID in _temp_keys;
        _oldOwner = (_ownerID == dayz_playerUID);
        if(locked _cursorTarget) then {
            if(_hasKey or _oldOwner) then {
                _Unlock = player addAction [format["Unlock %1",_text], "\z\addons\dayz_code\actions\unlock_veh.sqf",_cursorTarget, 2, true, true, "", ""];
                s_player_lockunlock set [count s_player_lockunlock,_Unlock];
                s_player_lockUnlock_crtl = 1;
            } else {
                if ((getPlayerUID player) in adminList) then {
                    _Unlock = player addAction [format["<t color='#ff0000'>Unlock %1</t>",_text], "\z\addons\dayz_code\actions\unlock_veh.sqf",_cursorTarget, 2, true, true, "", ""];
                } else {
                    _Unlock = player addAction ["<t color='#ff0000'>Vehicle Locked</t>", "",_cursorTarget, 2, true, true, "", ""];
                };
                s_player_lockunlock set [count s_player_lockunlock,_Unlock];
                s_player_lockUnlock_crtl = 1;
            };
        } else {
            if(_hasKey or _oldOwner) then {
                _lock = player addAction [format["Lock %1",_text], "\z\addons\dayz_code\actions\lock_veh.sqf",_cursorTarget, 1, true, true, "", ""];
                s_player_lockunlock set [count s_player_lockunlock,_lock];
                s_player_lockUnlock_crtl = 1;
            } else {
                if ((getPlayerUID player) in adminList) then {
                    _lock = player addAction [format["<t color='#ff0000'>Lock %1</t>",_text], "\z\addons\dayz_code\actions\lock_veh.sqf",_cursorTarget, 1, true, true, "", ""];
                    s_player_lockunlock set [count s_player_lockunlock,_lock];
                    s_player_lockUnlock_crtl = 1;
                };
            };
        };
    };
     
} else {
    {player removeAction _x} forEach s_player_lockunlock;s_player_lockunlock = [];
    s_player_lockUnlock_crtl = -1;
};
 
Ah, Very nice. Since I'm totally new to this, I dont know default global variables that can be used and things are slightly different than in PHP for the syntax and normally how things are called so I didnt want to attempt something with arrays until I learned more. Thanks for showing me this, How do you make your adminList a global? is it due to not using the _variable and just calling it varable instead? and do you need to add an include somewhere to see that array in the selfActions?

Sorry if this seems like thread jacking, but could be useful to OP to know this also.
 
Well u need to override compiles.sqf within init.sqf and then fn_selfactions.sqf in compiles.

the underscore denoted a private var within the scope of the file but its good practise to use
Code:
private["_var1", "_var2"];
To avoid collisions.

You can use the private statement within code blocks to keep the variaible within it.
Code:
{
    private ["_var1"];
    _var1 = _x;
    // Here _var1 == _x
} forEach [1,2,3,4];
 
// Here _var1 == nil

If im wrong please someone correct me but im pretty sure this is correct

Oh another thing to prevent collisions (no namespaces =( ) prepend variables with something meaningful...
 
Dopple, pretty much what i have

I have my admin uid's defined in init.sqf
Code:
adminList = ["00000", "000000"];

And I have overidden selfActions

Code:
// Allow Owner to lock and unlock vehicle 
if(_isVehicle and _isAlive and !_isMan and _ownerID != "0") then {
    if (s_player_lockUnlock_crtl < 0) then {
        _hasKey = _ownerID in _temp_keys;
        _oldOwner = (_ownerID == dayz_playerUID);
        if(locked _cursorTarget) then {
            if(_hasKey or _oldOwner) then {
                _Unlock = player addAction [format["Unlock %1",_text], "\z\addons\dayz_code\actions\unlock_veh.sqf",_cursorTarget, 2, true, true, "", ""];
                s_player_lockunlock set [count s_player_lockunlock,_Unlock];
                s_player_lockUnlock_crtl = 1;
            } else {
                if ((getPlayerUID player) in adminList) then {
                    _Unlock = player addAction [format["<t color='#ff0000'>Unlock %1</t>",_text], "\z\addons\dayz_code\actions\unlock_veh.sqf",_cursorTarget, 2, true, true, "", ""];
                } else {
                    _Unlock = player addAction ["<t color='#ff0000'>Vehicle Locked</t>", "",_cursorTarget, 2, true, true, "", ""];
                };
                s_player_lockunlock set [count s_player_lockunlock,_Unlock];
                s_player_lockUnlock_crtl = 1;
            };
        } else {
            if(_hasKey or _oldOwner) then {
                _lock = player addAction [format["Lock %1",_text], "\z\addons\dayz_code\actions\lock_veh.sqf",_cursorTarget, 1, true, true, "", ""];
                s_player_lockunlock set [count s_player_lockunlock,_lock];
                s_player_lockUnlock_crtl = 1;
            } else {
                if ((getPlayerUID player) in adminList) then {
                    _lock = player addAction [format["<t color='#ff0000'>Lock %1</t>",_text], "\z\addons\dayz_code\actions\lock_veh.sqf",_cursorTarget, 1, true, true, "", ""];
                    s_player_lockunlock set [count s_player_lockunlock,_lock];
                    s_player_lockUnlock_crtl = 1;
                };
            };
        };
    };
   
} else {
    {player removeAction _x} forEach s_player_lockunlock;s_player_lockunlock = [];
    s_player_lockUnlock_crtl = -1;
};

Tested and working as intended. Thank you maca134!

@Doppelganger Your script also works, only reason i used maca134's script was because i liked the admins being defined in the init.sqf Thank you for the help :)

That's the key issues fixed temporarily, you guys should post a release in the release section and on the epoch forums. I've still been working on the other ones with either buggy results or none working at all. Main thing i've been wanting to get is my admin tools ported from a scroll menu to a GUI menu but the issue is most of the scripts are made for scrolling to execute them on players instead of clicking a player on a GUI so i will most likely try and make my own menu for admins myself with no scripts that can be used to corrupt a server. Maybe only a Server Owner will have stuff to Kill players incase they are stuck at debug or something, but even then maybe just a TP Player will do just fine.
 
Glad to hear it worked. Thanks for testing it. I want to make it so locked vehicles don't show the gear to other players and only the owner, but if the vehicle is unlocked, all players can see the gear option. does that make sense?

we have a huge problem of looters in our small community, stealing all supplies constantly and no one will admit who it is, so i wanted the gear to be hidden if they don't own the vehicle.
 
Removing the gear option isn't an easy one to solve, i have talked to the Epoch guys for hours to try and come up with a solutions. The only ways we can up with would be laggy as ....!
 
Glad to hear it worked. Thanks for testing it. I want to make it so locked vehicles don't show the gear to other players and only the owner, but if the vehicle is unlocked, all players can see the gear option. does that make sense?

we have a huge problem of looters in our small community, stealing all supplies constantly and no one will admit who it is, so i wanted the gear to be hidden if they don't own the vehicle.

I've been trying to solve or find a solution to that for awhile now, doesn't look like its going to be possible at the moment. I thought adding something to the self actions to remove the option for gear might have worked but no luck
 
Wow guys, awesome, thank you very much! This will save such a lot of time and effort, I haven't implemented this yet (still at work) but I'm sure that it'll work now that I have a quick look. I'm not a coder by any stretch of the imagination, but I've learnt so much in my last two weeks, it's actually heaps of fun lol.

Thanks again guys, very much appreciated by myself and everyone on the server :D
 
Is it posible to make admins able to open safes ?

Here's the default epoch unlock vault script Doppelganger, might save nerdalertdk some messing around getting it and get it working sooner

//Allow owner to unlock vault
if((_typeOfCursorTarget == "VaultStorageLocked" or _typeOfCursorTarget == "VaultStorage") and _ownerID != "0" and (player distance _cursorTarget < 3)) then {
if (s_player_unlockvault < 0) then {
if(_typeOfCursorTarget == "VaultStorageLocked") then {
if(_ownerID == dayz_combination or _ownerID == dayz_playerUID) then {
_combi = player addAction ["Open Safe", "\z\addons\dayz_code\actions\vault_unlock.sqf",_cursorTarget, 0, false, true, "",""];
} else {
_combi = player addAction ["Unlock Safe", "\z\addons\dayz_code\actions\vault_combination_1.sqf",_cursorTarget, 0, false, true, "",""];
};
s_player_combi set [count s_player_combi,_combi];
s_player_unlockvault = 1;
} else {
if(_ownerID != dayz_combination and _ownerID != dayz_playerUID) then {
_combi = player addAction ["Enter Combo", "\z\addons\dayz_code\actions\vault_combination_1.sqf",_cursorTarget, 0, false, true, "",""];
s_player_combi set [count s_player_combi,_combi];
s_player_unlockvault = 1;
};
};
};
} else {
{player removeAction _x} forEach s_player_combi;s_player_combi = [];
s_player_unlockvault = -1;
};
 
Thanks blacksheep25

This is pretty much the same hack as above, im learning more about scripting but lets just keep it basic.

Code:
//Allow owner to unlock vault
//Enter admins PlaerUID
_dayz_admin = 1234567890;
 
if (_dayz_admin == dayz_playerUID) then {
_admin = dayz_playerUID;
};

if((_typeOfCursorTarget == "VaultStorageLocked" or _typeOfCursorTarget == "VaultStorage") and _ownerID != "0" and (player distance _cursorTarget < 3)) then {
if (s_player_unlockvault < 0) then {
if(_typeOfCursorTarget == "VaultStorageLocked") then {
if(_ownerID == dayz_combination or _ownerID == dayz_playerUID or _admin == dayz_playerUID;) then {
_combi = player addAction ["Open Safe", "\z\addons\dayz_code\actions\vault_unlock.sqf",_cursorTarget, 0, false, true, "",""];
} else {
_combi = player addAction ["Unlock Safe", "\z\addons\dayz_code\actions\vault_combination_1.sqf",_cursorTarget, 0, false, true, "",""];
};
s_player_combi set [count s_player_combi,_combi];
s_player_unlockvault = 1;
} else {
if(_ownerID != dayz_combination and _ownerID != dayz_playerUID) then {
_combi = player addAction ["Enter Combo", "\z\addons\dayz_code\actions\vault_combination_1.sqf",_cursorTarget, 0, false, true, "",""];
s_player_combi set [count s_player_combi,_combi];
s_player_unlockvault = 1;
};
};
};
} else {
{player removeAction _x} forEach s_player_combi;s_player_combi = [];
s_player_unlockvault = -1;
};

Just edit the "1234567890" with your real ID that you can find in the database for character names and it should work.

I am going to try and figure out where the gear portion of the actions are stored for vehicles, maybe selfactions but im at work and dont have access to my server files to look, so i can try and look into changing it, any idea blacksheep?
 
Yeah i was going to do it myself but i've ran into alot of issues when changing the map to DayZ Epoch Sahrani on my server and need to get it all sorted out. Thanks for helping everyone out with the epoch scripts, should be amazing when we get some more features added for admin management
 
Yeah, but as far as I know the vechical and safe scripts work on to difference ways

I get the open safe menu, when pressed he start working on open it but after 5 sec it says wrong compi.…
 
Back
Top