17.07.2016, 12:23
So would this work?
if they tab it will attach the label, and update it every second?
and delete the label again when the player gets back?
if they tab it will attach the label, and update it every second?
and delete the label again when the player gets back?
pawn Код:
for(new i=0; i<MAX_PLAYERS; i++)
{
new PausedSeconds = gettime()-PauseTime[i], string[50];
if(PausedSeconds > 60) // check if it's above 1 minute.
{
format(string, 50, ""COL_YELLOW"Paused for (%d) minutes\n|\nV\n", SecondsToMinutes(PausedSeconds));
minspause[i] = Create3DTextLabel(string, 0xFFFFFFFF, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(minspause[i],i, 0.0, 0.0, 0.3);
}
else if(PausedSeconds < 60 && PausedSeconds > 0) // checks if it's below 1 minute but above 0 seconds.
{
format(string, 50, ""COL_YELLOW"Paused for (%d) seconds\n|\nV\n", PausedSeconds);
secspause[i] = Create3DTextLabel(string, 0xFFFFFFFF, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(secspause[i],i, 0.0, 0.0, 0.3);
}
}
for(new i=0; i<MAX_PLAYERS; i++)
{
if(PauseTime[i] > 0)
{
new PausedSeconds = gettime()-PauseTime[i], string[50];
if(PausedSeconds > 60) // check if it's above 1 minute.
{
format(string, 50, ""COL_YELLOW"Paused for (%d) minutes\n|\nV\n", SecondsToMinutes(PausedSeconds));
Update3DTextLabelText(minspause[i], 0xFFFFFFFF, string);
}
else if(PausedSeconds < 60 && PausedSeconds > 0) // checks if it's below 1 minute but above 0 seconds.
{
format(string, 50, ""COL_YELLOW"Paused for (%d) minutes\n|\nV\n", PausedSeconds);
Update3DTextLabelText(secspause[i], 0xFFFFFFFF, string);
}
}
}
for(new i=0; i<MAX_PLAYERS; i++)
{
if(PauseTime[i] == 0)
{
Delete3DTextLabel(minspause[i]);
Delete3DTextLabel(secspause[i]);
}
}