Stephen Tewell
Member
trying to get a pack generator script working, kind of like pack vault.
can't get the fn-self actions right,
this is what I have.
I want the generator to be pack able by any player, but only if it is NOT running. I had the option pop up once, but adjusted some code to what I thought was better without saving a copy and lost it. This is what I believe to be optimized however no options, and it breaks the other self actions.
SO basically, where is my missing colon?
can't get the fn-self actions right,
this is what I have.
I want the generator to be pack able by any player, but only if it is NOT running. I had the option pop up once, but adjusted some code to what I thought was better without saving a copy and lost it. This is what I believe to be optimized however no options, and it breaks the other self actions.
SO basically, where is my missing colon?
Code:
//Start Generator
if(_cursorTarget isKindOf "Generator_DZ") then {
if (s_player_fillgen < 0) then {
// check if not running
if((_cursorTarget getVariable ["GeneratorRunning", false])) then {
s_player_fillgen = player addAction ["Stop Generator", "\z\addons\dayz_code\actions\stopGenerator.sqf",_cursorTarget, 0, false, true, "",""];
} else {
// check if not filled and player has jerry.
if((_cursorTarget getVariable ["GeneratorFilled", false])) then {
s_player_fillgen = player addAction ["Start Generator", "\z\addons\dayz_code\actions\fill_startGenerator.sqf",_cursorTarget, 0, false, true, "",""];
} else {
if("ItemJerrycan" in _magazinesPlayer) then {
s_player_fillgen = player addAction ["Fill and Start Generator", "\z\addons\dayz_code\actions\fill_startGenerator.sqf",_cursorTarget, 0, false, true, "",""];
};
};
};
};
if (s_player_packgenerator < 0) then {
// check if running
if((_cursorTarget getVariable ["GeneratorRunning", false])) then {
exitWith {};
} else {
if (s_player_packgenerator < 0) then {
s_player_packgenerator = player addAction [format["<t color='#ff0000'>Pack %1</t>",_text],"Scripts\player_packgenerator.sqf", "_cursorTarget", 0, false ,true, "",""];
};
};
};
} else {
player removeAction s_player_fillgen;
s_player_fillgen = -1;
player removeAction s_player_packgenerator;
s_player_packgenerator = -1;
};