OBJECTIVE: To have a timer on the screen showing the minutes and seconds left till the end of the game.
SHORT VERSION:
How can I output the result of the above timer without having it instantly overwrite every string the game sprints and bprints?
LONG VERSION:
The current 'solution' is to only display the timer if a new variable .timerclear is less than or equal to time.
Code: Select all
// this is called every time a player gets printed something
// it pauses the display of the timer by 3 seconds
void(entity pl) TimerClear =
{
pl.timer_clear = time + 3;
};
Code: Select all
// output the results to the players
while (n < 32)
{
n = n+1;
e = nextent(e);
// an entitys .timer_clear gets set to time+3 every time the game prints something on screen
if(e.timer_clear <= time)
centerprint(e, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n Time left: ", stminutes, ":", sttens, stones);
}
};
This works with centerprints because I can insert a call to TimerClear (and set players .timer_clear to time+3), BUT I can't do this in sprint, because sprint is a builtin!
defs.qc has the following functions that also print stuff to the screen:
Code: Select all
//void(entity client, string s) sprint = #24;
void(...) nqw_bprint = #23;
void(...) nqw_sprint = #24;
// used for QW compatibility
void(...) bprint = #23;
void(...) sprint = #24;
void(...) bprint2 = #23;
void(...) sprint2 = #24;
.
.
.
... what are my options?
thanks in advance,
OneManClan
ps, Reminder, I'm still a newb, so please don't hesitate to dumb down your responses