Jump to content
Sign in to follow this  
BorderlineHypeR

Help with a UAV script on a MP server

Recommended Posts

Hello BI forums! This is my first post, so please be gentle :p

I moderate a server and wanted to make a script that:

1. Checks for the player ID of an admin/mod (we already have them)

2. If the ID is met, give the option to spawn a UAV

3. When the UAV is spawned, it is spawned flying, with an MTVR synchronized next to it as a terminal.

I have done those parts, the only problem is, the UAV cannot be controlled, it just shows up as a blank screen until it crashes. My code may be sloppy as I'm fairly new to this, but any help would be appreciated!

/*Grabbing player ids*/
if ((getPlayerUID player) in ["PID" , "PID" , "PID" , "PID" , "PID" , "PID" , "PID" , "PID"]) exitWith{
/*Local vars*/
_unit = player;
_x = getPos player select 0;
_y = getPos player select 1;
_z = getPos player select 2;
_uav = createVehicle ["MQ9PredatorB", position _unit, [],0,"fly"];
_mtvr = createVehicle ["MTVR", position _unit, [],0, "null"];
/*Syncing UAV Module to player, UAV and MTVR*/
uavModule synchronizeObjectsAdd [_unit, _uav, _mtvr];
/*UAV SetPos, does what it says on the tin*/
_uav setPos [getPos player select 0, getPos player select 1, 500];
/*group units*/
[_uav, _mtvr] join (group _unit);
/*Needs more weapons!*/
_uav addMagazine "4Rnd_Sidewinder_AV8B"; 
_uav addWeapon "SidewinderLaucher";
/*Experimental*/
/*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];
	};
   };

Edited by BorderlineHypeR
Code error

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×