Jump to content
redburn

mission state comparison on server

Recommended Posts

How can I do to buy if BIS_fnc_endMissionServer has been executed with conditionals?

 

try doing the following:

 

if (typeName BIS_fnc_endMissionServer == 1 ) exitWith {
	while {true} do {
		["<t font = 'PuristaMedium'><t size = '1'><t color = '#00ffd8'>" + timedisplay + "</t>",-1,0.10,10,0,0,789] spawn BIS_fnc_dynamicText;
		sleep 10;
	};
};

but without success, can someone tell me how to compare this so that, for example, are stopped the chronometer all players ?

  • Confused 1

Share this post


Link to post
Share on other sites

@HazJ I have an accountant with a countdown, but what happens is that when someone completes a goal to whom I execute the script, the time is stopped for de player in the upper, but the rest of the timer on the others players continues without stopping. and I would like in that case to make a comparison

 

I tried to make a global variable to run on all PCs in case the action happens, but apparently does not produce what was expected.

Share this post


Link to post
Share on other sites

I don't understand the relationship with BIS_fnc_endMissionServer...

Perhaps you can produce some scripts easier to understand than your request...

  • Like 1

Share this post


Link to post
Share on other sites
18 minutes ago, pierremgi said:

I don't understand the relationship with BIS_fnc_endMissionServer...

Perhaps you can produce some scripts easier to understand than your request...

 

This is my example:

 

//cronometre.sqf

private _terminarTiempo = true;

checkrun = true;
//////so that the script works once


_publicTime = _this select 0;



publicTimerON = true;

//////////////////////
publicTimerOver = false;
detenerTiempo = false;



while {publicTimerON && _publicTime>10} do { //while it is greater than 10 seconds
	_publicTime = _publicTime -1;
	sleep 1;
	_timestamp = _publicTime/3600;

	if (detenerTiempo) exitWith {
			while {true} do {
				
				["<t font = 'PuristaMedium'><t size = '1'><t color = '#00ffd8'>" + timedisplay + "</t>",-1,0.10,10,0,0,789] spawn BIS_fnc_dynamicText;
				sleep 10;
			};
		};

	timedisplay = [_timestamp, "HH:MM:SS"] call BIS_fnc_timeToString;
	["<t font = 'PuristaMedium'><t size = '1'>" + timedisplay + "</t>",1,-0.15,1,0] spawn BIS_fnc_dynamicText; 


};

//Last 10 seconds in red with a beep
while {publicTimerON && _publicTime<=10 && _publicTime> 1} do { //as long as it is less than or equal to 10 and greater than 1

	_publicTime = _publicTime -1;
	sleep 1;
	_timestamp = _publicTime/3600;

	if (detenerTiempo) exitWith {
		while {true} do {
			
				["<t font = 'PuristaMedium'><t size = '1'><t color = '#00ffd8'>" + timedisplay + "</t>",-1,0.10,10,0,0,789] spawn BIS_fnc_dynamicText;
				sleep 10;
			};
	};

	timedisplay = [_timestamp, "HH:MM:SS"] call BIS_fnc_timeToString;
	["<t font = 'PuristaMedium'><t size = '1'><t color = '#FF0000'>" + timedisplay + "</t>",-1,-1,1,0] spawn BIS_fnc_dynamicText;
	playSound "time";

};

while {publicTimerON && _publicTime>= 0} do { //if it is less than 1 and equal or greater 0
	_publicTime = _publicTime -1;
	sleep 1;
	_timestamp = _publicTime/3600;
	_fin = [_timestamp, "HH:MM:SS"] call BIS_fnc_timeToString;
	["<t font = 'PuristaMedium'><t size = '1'><t color = '#FF0000'>" + "00:00:00" + "</t>",-1,0.10,10,1,0,789] spawn BIS_fnc_dynamicText;
};

checkrun = false;
if (_publicTime <= 0) exitWith { //Yes, the time reaches 0 then load mission end.
	publicTimerOver = true; 
	publicVariable "publicTimerOver"; 
	"EVERYONELOST" call BIS_fnc_endMissionServer;
	
}; 

 

in the flag

 

//flag.sqf

detenerTiempo = false;
publicVariable "detenerTiempo";

[fam, //Nombre del objeto
"Terminar Partida", // Titulu de la acción
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", //El icono que se mostrara en pantalla (chequeara descripcion para este icono)
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", // Icono de progreso mostrado en pantalla (cambios de icono cuando inicia la accion)
"player distance fam < 5", // La condicion para la accion a mostrar
"player distance fam < 5", // La condicion para la accion en progreso
{}, // El codigo ejecutado cuando la accion inicia (esto no sera usado por el momento)
{}, // El codigo ejecutado en todo el tick del progreso (eso no sera usado por ahora)
{detenerTiempo = true; "EVERYONEWON" remoteExecCall ["BIS_fnc_endMissionServer", 0, true]; }, //El codigo ejecutado para completar
{hint "Manten Presionado finalizar la misión"},  //El codigo ejecutado cuando el jugador es interrumpido (jugador le va por la key)
[], // Argumentos pasados al Script (eso no sera usado por el momento)
5, // la duracion (como sera de largo el proceso de accion para completar en segundos)
0, // prioridad (seguro sobre dejar esto en 0)
true, // Elimina la accion cuando la misma ya ha sido completada (true o false)
false // Muestra en estado inconciente (tener seguro dejar esto en false para que trabaje)
] remoteExec ["BIS_fnc_holdActionAdd", [0,-2] select isDedicated, true]; //Esto permite el trabajo en el server!

place the variable in flag as global (publicVariable "stopTime") so that when it changes to true, immediately the stopwatch stops for all and do what I ordered in a stopwatch, I freeze the time showing in what time that action was finished, but only is paralyzed for who did it, not for all

Share this post


Link to post
Share on other sites

I think you are trying to check the typeName of the callback from function but surely for you to do that you must pass an argument to it? That is also pointless as that function only returns a BOOLEAN value. Why are you using remoteExec with BIS_fnc_endMissionServer? Doesn't make sense... The while loop will of course continue to run as you haven't added a condition or exitWith for it. At least I couldn't see, your variables and comments aren't in English (most).

// while {publicTimerON && _publicTime>10} do { //while it is greater than 10 seconds
while {!detenerTiempo && {publicTimerON && _publicTime > 10}} do
{

Why not just change publicTimerON? No need for additional variables that do the same thing.

https://community.bistudio.com/wiki/BIS_fnc_endMissionServer

Quote

Ends the mission properly for all players in a multiplayer environment.

 

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

×