Forum Jump :

Author Message


Posts: 2
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#1 Posted at 2014-05-11 19:27        
     
Hello Armaholic! Long time lurker, 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 ["id" , "id" , "id" , "id" , "id" , "id" , "id" , "id"]) 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"];
	_pilot assignAsDriver _uav;
	/*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*/
	processInitCommands;
	[assignedGunner _uav] join player;
	/*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];
		};
    };


Author Message


Posts: 1526
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#2 Posted at 2014-05-11 20:06        
     
where has the pilot come from have you created him somewhere else if not try this
    _grp = createGroup west; 
    _pilot = _grp createunit ["InvisibleManW_EP1",position _unit,[],0,"none"];
    _pilot assignAsDriver _uav;


Advertisement


Author Message


Posts: 2
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#3 Posted at 2014-05-11 21:22        
     
I have no clue really, I was just trying a load of scripts online, unfortunately, that didn't fix the problem, thankyou for the response though!

Edit: Spelling

This post was edited by BorderlineHypeR (2014-05-11 21:55, ago)