Jump to content
Sign in to follow this  
1para{god-father}

Time set for Mission

Recommended Posts

Having a issue setting the time for a game, have checked the parameters and they are correct i.e 6,7,8,9.

But when i start the game i only ever get the time set in the editor ? not what i change it to any reason ?

Tested on dedi and hosted

INIT

call compile preprocessFileLineNumbers "initServer.sqf";

initServer.sqf

_month  = (paramsArray select 6); 
_day    = (paramsArray select 7);
_hour   = (paramsArray select 8); 
_minute = (paramsArray select 9);

setDate [2010, _month, _day, _hour, _minute + (time/60)]; 

descript

bla bla bla removed above 

////number 6///
	class Month { 	
		title="Month"; 
		values[]={ 1,2,3,4,5,6,7,8,9,10,11,12}; 
		texts[]={ "January","Febuary", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}; 
		default=8; 
		code = ""; 
	}; 
	class Day { 
		title="Day"; 
		values[]={ 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31}; 
		texts[]={ "1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31"}; 
		default=22; 
		code = ""; 
	}; 
	class Hour { 
		title="Hour"; 
		values[]={ 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24}; 
		texts[]={ "1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24"}; 
		default=12; 
		code = ""; 
	}; 
	class Minute { 
		title="Minute"; 
		values[]={ 00,15,30,45}; 
		texts[]={ "00","15","30","45"}; 
		default=00; 
		code = ""; 
	};

Share this post


Link to post
Share on other sites

Copy pasted all those, works fine in hosted at least. So, problem is most likely somewhere else.

Edited by Shuko

Share this post


Link to post
Share on other sites

Are you running it from the init.sqf? If so, change it to run from an init line of a unit or game logic. Otherwise, it'll set the time/date on the server after players load the mission, giving them the editor's time/date instead (since changing time/date is local, but is updated to players once when they load the mission). The init.sqf runs after the server finishes loading the mission and clients start loading it, while init lines of units and game logics always run before clients even get a chance to start loading the mission.

Also, to make sure the script actually runs, add to your script:

hint str [2010, _month, _day, _hour, _minute + (time/60)];

Which will give a hint on the host with the actual array of parameters, letting you know that this part of the script is actually running and if the values are actually correct.

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  

×