Hello, I have written a script that allows a moderator/admin to spawn in a flying UAV and an MTVR as a control terminal, I have it all working, but I have no experience with Epoch itself. Apparently I need to add the file to the fn_selfActions, but how would I sync it to specific player ID's etc? If anyone wants to see the scripts, they are here:
init.sqf:
callUavScript.sqf
uavDeleteScript.sqf
uavScript.sqf
I have no clue on how to implement this into Epoch, as I have no clue what the fn_selfActions does, or if I need the addActions whatsoever, or how it calls, as it's not my server I'm putting the script on, it's another persons (he owns the server.)
Any help would be appreciated!
Thanks
-HypeR
Skype: jmx457
init.sqf:
Code:
execVM "callUavScript.sqf"
execVM "uavDeleteScript.sqf"
callUavScript.sqf
Code:
if ((getPlayerUID player) in ["PID" , "PID" , "PID" , "PID" , "PID" , "PID" , "PID" , "PID"]) then{
player addAction ["<t color = '#00FFFF'>Add UAV</t>", "uavScript.sqf"];
player addAction ["<t color='#DF7401'>Delete UAV</t>", "uavDeleteScript.sqf"];
};
uavDeleteScript.sqf
Code:
/*Grabbing player ids*/
if ((getPlayerUID player) in ["PID" , "PID" , "PID" , "PID" , "PID" , "PID" , "PID" , "PID"]) then{
//Made by Scenic of UG & OpenDayZ on 26/04/2014
_ct = cursorTarget;
if (_ct isKindOf "LandVehicle") then
{
cutText ["Cursor target deleted.", "PLAIN"];
DeleteIT = "deleteVehicle cursorTarget;";
DeleteIT2 = "deleteVehicle uav;";
DeleteIT3 = "delete uavPilot;";
DeleteIT4 = "delete uavGunner;";
[] spawn compile DeleteIT;
[] spawn compile DeleteIT2;
[] spawn compile DeleteIT3;
[] spawn compile DeleteIT4;
}
else
{
cutText ["Cursor target isn't a vehicle!", "PLAIN"];
};
};
uavScript.sqf
Code:
/*Grabbing player ids*/
if ((getPlayerUID player) in ["PID" , "PID" , "PID" , "PID" , "PID" , "PID" , "PID" , "PID"]) then{
/*Local vars*/
_unit = player;
_grp = createGroup west;
uav = createVehicle ["MQ9PredatorB", position player, [], 0, "fly"];
uav flyInHeight 800;
uav setVariable ["rules",[west]];
mtvr = createVehicle ["MTVR", position _unit, [],0, "null"];
_mtvr setPos (player modelToWorld [10,0,0]);
_mtvr setDir ([mtvr, player] call BIS_fnc_dirTo);
uavPilot = _grp createunit ["InvisibleManW_EP1",position uav,[],0,""];
uavPilot moveInDriver uav;
uavGunner = _grp createunit ["InvisibleManW_EP1",position uav,[],0,""];
uavGunner moveInGunner uav; _unit setBehaviour "CARELESS"; _unit setCombatMode "BLUE"; _unit setCaptive true; _unit disableAI "AUTOTARGET";_unit disableAI "TARGET";
/*Syncing UAV Module to player, UAV and MTVR*/
uavModule synchronizeObjectsAdd [_unit, uav, mtvr];
/*group units*/
[uav, mtvr] join (group _unit);
/*Needs more weapons!*/
uav addMagazine "4Rnd_Sidewinder_AV8B";
uav addWeapon "SidewinderLaucher";
/*Arty text BS*/
titleText ["UAV above!", "PLAIN DOWN", 2];
sleep 3;
hint "";
};
else{
titleText ["You do not have the permission to use this feature", "PLAIN DOWN", 2];
};
};
I have no clue on how to implement this into Epoch, as I have no clue what the fn_selfActions does, or if I need the addActions whatsoever, or how it calls, as it's not my server I'm putting the script on, it's another persons (he owns the server.)
Any help would be appreciated!
Thanks
-HypeR
Skype: jmx457