Auto Msg Script (help without bec)

Hi guys I'm trying to make a automatic messages before reboot without bec. It's supposed to work but it's not...

Code:
private ["_mainTextColour","_subTextColour","_hint"];
 
_subTextColour = "#FFFFFF";
_mainTextColour = "#4BC9B0";
 
    if (300 = time) then {
    _hint = parseText format ["<t align='center' color='%2' shadow='2' size='1.75'>Side Objective</t><br/><t align='center' color='%2'>------------------------------</t><br/><t color='%3' size='1.0'>Starting in %1 Minutes</t>", _mainTextColour, _subTextColour];
    [nil,nil,rHINT,_hint] call RE;
    }

I think the prob is there " if (300 = time)" but i doesn't know why because the syntaxe is good...

Thank you
Snipezz_Qc
 
Hi guys I'm trying to make a automatic messages before reboot without bec. It's supposed to work but it's not...

Code:
private ["_mainTextColour","_subTextColour","_hint"];
 
_subTextColour = "#FFFFFF";
_mainTextColour = "#4BC9B0";
 
    if (300 = time) then {
    _hint = parseText format ["<t align='center' color='%2' shadow='2' size='1.75'>Side Objective</t><br/><t align='center' color='%2'>------------------------------</t><br/><t color='%3' size='1.0'>Starting in %1 Minutes</t>", _mainTextColour, _subTextColour];
    [nil,nil,rHINT,_hint] call RE;
    }

I think the prob is there " if (300 = time)" but i doesn't know why because the syntaxe is good...

Thank you
Snipezz_Qc
Have you tried (time == 300)
 
Thanks for ur help but it doesn't work...

Here is the description of "time" "Time elapsed since mission started (in seconds)."

So it supposed to pop up the msg 5 mins after de server reboot but it doesn't...
 
I have test the pop up message it work, is the time the problem ;(
I'm confused - you mean your code in the if statement works?
Just try this

Code:
private ["_mainTextColour","_subTextColour","_hint"];
 
_subTextColour = "#FFFFFF";
_mainTextColour = "#4BC9B0";
 
    if (time < 299) then {
          //MY ADDITION
        diag_log(format ["DEBUG RESTART MESSAGE|||| %1",time]);
        //END MY ADDITON
          _hint = parseText format ["<t align='center' color='%2' shadow='2' size='1.75'>Side Objective</t><br/><t align='center' color='%2'>------------------------------</t><br/><t color='%3' size='1.0'>Starting in %1 Minutes</t>", _mainTextColour, _subTextColour];
        [nil,nil,rHINT,_hint] call RE;
    }
added diag_log, changed to if (time < 299)
Where are you calling this code? init.sqf?
 
nope doesn't work... I put it in system and I call it with compile.sqf (init)
Code:
private ["_mainTextColour","_subTextColour","_hint"];
diag_log(format ["DEBUG RESTART MESSAGE || inizializing || %1",round(time)]);
_subTextColour = "#FFFFFF";
_mainTextColour = "#4BC9B0";
//try if before waituntil
if (time > 299) then {
          diag_log(format ["DEBUG RESTART MESSAGE||inside if1 no round|| %1",time]);
 
          _hint = parseText format ["<t align='center' color='%2' shadow='2' size='1.75'>Side Objective</t><br/><t align='center' color='%2'>------------------------------</t><br/><t color='%3' size='1.0'>Starting in %1 Minutes</t>", _mainTextColour, _subTextColour];
        [nil,nil,rHINT,_hint] call RE;
    };
//try again with (round(time))
if ((round(time)) > 299) then {
          diag_log(format ["DEBUG RESTART MESSAGE||inside if1 round|| %1",time]);
 
          _hint = parseText format ["<t align='center' color='%2' shadow='2' size='1.75'>Side Objective</t><br/><t align='center' color='%2'>------------------------------</t><br/><t color='%3' size='1.0'>Starting in %1 Minutes</t>", _mainTextColour, _subTextColour];
        [nil,nil,rHINT,_hint] call RE;
    };
//try waituntil
waituntil {(round(time)) > 299};
diag_log(format ["DEBUG RESTART MESSAGE || waituntil || %1",round(time)]);
    //try if again
    if (time > 299) then {
          diag_log(format ["DEBUG RESTART MESSAGE||inside if2 no round|| %1",time]);
 
          _hint = parseText format ["<t align='center' color='%2' shadow='2' size='1.75'>Side Objective</t><br/><t align='center' color='%2'>------------------------------</t><br/><t color='%3' size='1.0'>Starting in %1 Minutes</t>", _mainTextColour, _subTextColour];
        [nil,nil,rHINT,_hint] call RE;
    };

try this. save it in the root of your mission pbo (eg restartMessage.sqf)
call it from the init.sqf in the mission pbo this way

_restartMessageDebug = [] execVM "restartMessage.sqf";

put that line in if (Server) then {


Then come back and post the output of your rpt showing us what's happening - it should say the time value at least once, rounded, maybe some more unrounded.
When you're looking for exactly time = 300; it has to execute when time equals exactly 300 for it to be true, so time > 300 should be better. Time can have decimals I think, which is why we've used the (round(time)) command, should give an even value.
 
Back
Top