Home   Help Search Login Register  

Author Topic: estimatedtimeleft param1  (Read 1333 times)

0 Members and 1 Guest are viewing this topic.

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
estimatedtimeleft param1
« on: 23 Jan 2003, 20:36:11 »
estimatedtimeleft param1

I want to use the above line , which is normally placed in the init.sqs
in a script, and its value be returned in the hint box

something basic like this

#start
~60
_countdownmsg=format["You have %1 mins remaining",estimatedtimeleft param1]
hint _countdownmsg
goto "start"
[/i]


when i run it, i get
You have <null> mins remaining


My understanding is that estimatedtimeleft param1
has got to be either a function or a global variable
My problem i believe is my syntax (as it nealry always is)
Could somebody explain what i have done wrong , not just give me the fix, thanks


I have easy ways to work around it using a set of variables etc and a looping counter, so please dont post your timer scripts.
I just want to incorporate the estimatedtimeleft param1
« Last Edit: 23 Jan 2003, 20:39:16 by Terox »
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Tactician

  • Guest
Re:estimatedtimeleft param1
« Reply #1 on: 24 Jan 2003, 16:52:07 »
I don't think you can use it like that at all.  It seems to just affect the "xx Minutes Remaining" shown when you presss 'P' and the time left from the browser.  There is another way:

Code: [Select]
;; begin timeLeft.sqs
_timeLeft = param1 - time
_timeLeft = _timeLeft - (timeLeft mod 1)
hint format["You have %1 minutes left", _timeLeft]
;; end timeLeft.sqs

This rounds the minutes remaining down to a whole number.  The result of the time function, of course, will be a little different for each client, but it's nothing life-threatening.

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:estimatedtimeleft param1
« Reply #2 on: 24 Jan 2003, 17:43:43 »
yeah thats what i am using at the moment or something similar

????  whats the  mod1 statement do????


Thx m8


« Last Edit: 24 Jan 2003, 17:49:44 by Terox »
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Offline Ranger

  • Members
  • *
  • Hoo-ah!
Re:estimatedtimeleft param1
« Reply #3 on: 24 Jan 2003, 18:07:06 »
Refer to the ComRef if you don't know what a command does.

a mod b
Operand types:
    a: Number
    b: Number
Type of returned value:
    Number

Description:
    remainder of a divided by b. Note remainer is calculated in real domain. 1

Example:
    3 mod 2 , result is 1


In his script, he used it to subtract the fractional part from the _timeleft variable so that you get a whole number to display in the hint.
Ranger