Jump to content
Sign in to follow this  
=101AD=Richard

any way to clean this up?

Recommended Posts

//begin init.sqf
// JIP fix - why does ArmA execute init.sqf for JIP players, if 'player' is not sync'd yet
if ((!isServer) && (player != player)) then
{
 waitUntil {player == player};
};

if (isServer) then
{
//Init UPSMON scritp
call compile preprocessFileLineNumbers "scripts\Init_UPSMON.sqf";	
};

setviewdistance 1600;
onMapSingleClick "player setpos _pos";

//Process statements stored using setVehicleInit
processInitCommands;

//Finish world initialization before mission is launched. 
finishMissionInit;


if(true) exitWith {}; 

enablesaving [false, false];

nopop = true;

if not isserver exitwith {};

launchskeet = false;
[] spawn {
while {true} do {
	waituntil {launchskeet};
	launchskeet = false;
	[] spawn {
		private ["_v", "_vel", "_i"];
		_v = "SkeetDisk" createvehicle getpos skeetmachine;
		_v setpos (skeetmachine modeltoworld [0, -0.6]);
		_v setvelocity [-9 * sin getdir skeetmachine, -9 * cos getdir skeetmachine, 10 + random 2];
		sleep 1;
		_vel = velocity _v;
		_i = 0;
		while {getpos _v select 2 > 0.1 and alive _v} do {
			_v setvelocity [(_vel select 0) / (1 + (_i / 10)), (_vel select 1) / (1 + (_i / 10)), (_vel select 2) / (1 + _i)];
			_i = _i + 0.1;
			sleep 0.1;
		};
		deletevehicle _v;
	};
};
};

Share this post


Link to post
Share on other sites

remove this line maybe??

if(true) exitWith {};

im wondering about this line??

if not isserver exitwith {};

should it not be if (!isServer) exitWith {};

And why not throw the skeet script into a seperate script and just execVM it from init.sqf instead, it will start same time anyways, wont be any difference but init.sqf will be cleaner.

Edited by Demonized

Share this post


Link to post
Share on other sites

Where to start...

You process init commands, but you haven't actually set any?

processInitCommands;

Haven't used the finishmissioninit myself so not really going to comment on that other than missions work just fine without it.

onMapSingleClick "player setpos _pos";

Are you sure you want the player to be able to warp around the map?

It doesn't even run all the code as it's told to exit the half way.

if(true) exitWith {}; 

People need to stop using/pasting that silly stuff. ;) SQF script will exit just fine on it's on when it comes to the end.

Share this post


Link to post
Share on other sites

Use the -showScriptErrors parameter to see the errors.

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  

×