Jump to content
  • 0

epoch admin tools. changed for admin events stored in server.pbo


js2k6

Question

I've been trying to re-write the way i currently call in my admin events using epoch admin tools

 

and i'm not having much luck.

 

I have a method that works, but i'd like to simplify it using the %1 and such, like the skin change tool uses. 

 

currently i have the event files stored in my server.pbo 

I added pveh like so, and i can call them from the tools. 

 

admincompiles.sqf inside server.pbo, (called from the bottom of init\server_functions.sqf)

// stop objects from despawning
ProtectObj = compile preprocessFileLineNumbers "\z\addons\dayz_server\adminevents\compiles\protectobj.sqf";
// fill boxes
gunCrate = compile preprocessFileLineNumbers "\z\addons\dayz_server\adminevents\compiles\gunCrate.sqf";
goldCrate = compile preprocessFileLineNumbers "\z\addons\dayz_server\adminevents\compiles\goldCrate.sqf";
buildCrate = compile preprocessFileLineNumbers "\z\addons\dayz_server\adminevents\compiles\buildCrate.sqf";

// events
"RaceJetski" addPublicVariableEventHandler {execVM "\z\addons\dayz_server\adminevents\race_jetski.sqf";};

// cleanup
"CleanupAdminEvent" addPublicVariableEventHandler {execVM "\z\addons\dayz_server\adminevents\cleanup.sqf";};

in AdminToolsMain.sqf I have

EventMenu = 
[
["",true],
["Jetski Race",[],"", -5,[["expression",format[_EXECscript8,"raceJetski.sqf"]]],"1","1"],
["", [], "", -5,[["expression", ""]], "1", "0"],
["Cleanup Running Event",[10],"", -5,[["expression",format[_EXECscript8,"cleanup.sqf"]]],"1","1"],
["Main Menu", [12], "#USER:epochmenustart", -5, [["expression", ""]], "1", "1"]
];

raceJetski.sqf

RaceJetski = true;
publicVariableServer "RaceJetski";

now this method does work, but it's horribly untidy and it also means I have to create a new file like raceJetski.sqf every time I create a new event, And i'd like to avoid it if possible. 

 

what I want to do is something like this...

 

admintoolsmain.sqf

EventMenu= 
[
["",true],
["Jetski Race",[],"",-5,[["expression",format[_EXECscript9,"RaceJetski","missionstart.sqf"]]],"1","1"],
["Other Admin Event",[],"",-5,[["expression",format[_EXECscript9,"otherEvent","missionstart.sqf"]]],"1","1"],
["Yet Another Event",[],"",-5,[["expression",format[_EXECscript9,"yetAnotherEvent","missionstart.sqf"]]],"1","1"]
["", [], "", -5,[["expression", ""]], "1", "0"],
["Cleanup Running Event",[10],"", -5,[["expression",format[_EXECscript8,"cleanup.sqf"]]],"1","1"],
["Main Menu", [12], "#USER:epochmenustart", -5, [["expression", ""]], "1", "1"]
];

so in missionstart.sqf 

(this is the bit i need help with!!!)

private ["_missionStart"];
_missionStart = _this select 0;

_missionStart = true;
publicVariableServer _missionStart;

but this doesn't work of course,  I'm just hoping someone can point me in the right direction. If what I want to do can't be done. that's fine. I'll continue using my old method. But I've gone through so many different links and guides, tried many different methods such as switch case, if, if else, nested ifs   and I feel like i'm just beating my head against the wall.

 

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Addition: 

playing around a bit more with the script. 

This now displays the hint with the correct word. but still wont exec the events. 

private ["_missionName","_var","_pveh"];
_missionName = _this select 0;
_var = format ["%1 = true",_missionName];
_pveh = format ["publicVariableServer %1",_missionName];

if (1>0) then {
	hint format ["you are spawning %1",_missionName];
	_var;
	_pveh;
	}
Link to comment
Share on other sites

  • 0

edit: got all my things working. have also been able to manually spawn in WAI missions using this

stumbled across a link on these forums, and edited it to fit. 

works like a charm.

 

(in case anyone in future ever stumbles across this post and wants to know how i got it working)

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
  • Advertisement
  • Discord

×
×
  • Create New...