16.07.2016, 21:42
(
Последний раз редактировалось MayaEU; 17.07.2016 в 16:22.
)
This should add a label above the player that says if the player is paused..
but the label will not appear
i have this on top of the gamemode
i have this onplayerconnect
and this at the timer that detects if the player is paused
and this detects if the player is no longer paused
but the label will not appear
i have this on top of the gamemode
pawn Код:
new Text3D:minpause[MAX_PLAYERS];
pawn Код:
minpause[playerid] = Create3DTextLabel(" ", 0xFFFFFFFF, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(minpause[playerid],playerid, 0.0, 0.0, 0.3);
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. secspause minpause minspause
{
format(string, 50, ""COL_AFK"Paused for (%d) minute\n|\nV\n", SecondsToMinutes(PausedSeconds));
Update3DTextLabelText(minpause[i], 0xFFFFFFFF, string);
}
else if(PausedSeconds > 120) // checks if it's below 2 minutes
{
format(string, 50, ""COL_AFK"Paused for (%d) minutes\n|\nV\n", SecondsToMinutes(PausedSeconds));
Update3DTextLabelText(minpause[i], 0xFFFFFFFF, string);
}
else if(PausedSeconds < 60 && PausedSeconds > 0) // checks if it's below 1 minute but above 0 seconds.
{
format(string, 50, ""COL_AFK"Paused for (%d) seconds\n|\nV\n", PausedSeconds);
Update3DTextLabelText(minpause[i], 0xFFFFFFFF, string);
}
}
pawn Код:
for(new i=0; i<MAX_PLAYERS; i++)
{
if(PauseTime[i] == 0)
{
Delete3DTextLabel(minpause[i]);
}
}