SA-MP Forums Archive
Pause textlable - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Pause textlable (/showthread.php?tid=364280)



Pause textlable - Mikkel_RE - 30.07.2012

Hello, im trying to make that when you pause your game it will attach a TextLable to the player which ways "Player is paused (%s) Seconds" can i get come help with that please?


Re: Pause textlable - Devilxz97 - 30.07.2012

credits to MP2

pawn Код:
#include a_samp
new PauseTime[MAX_PLAYERS];

public OnPlayerUpdate(playerid)
{
    PauseTime[playerid] = gettime();
    return 1;
}

public OnGameModeInit()
{
    SetTimer("pausecheck", 4321, true);
    return 1;
}

forward pausecheck();
public pausecheck()
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
            new PausedSeconds = gettime()-PauseTime[i];
            if(PausedSeconds > 5)
            SetPlayerChatBubble(i, "Paused", -1, 100.0, 5000);
    }
    return 1;
}
this is SnG.Scot_MisCuDI old scripting helps
and get helps by MP2 . .


Re: Pause textlable - DeathTone - 30.07.2012

pawn Код:
#include a_samp
new PauseTime[MAX_PLAYERS];

public OnPlayerUpdate(playerid)
{
    PauseTime[playerid] = gettime();
    return 1;
}

public OnGameModeInit()
{
    SetTimer("pausecheck", 4321, true);
    return 1;
}

forward pausecheck();
public pausecheck()
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
            new PausedSeconds = gettime()-PauseTime[i], string[50];
            if(PausedSeconds > 5){
            format(string, 50, "Paused (%d)", PausedSeconds);
            SetPlayerChatBubble(i, string, -1, 100.0, 5000);
            }
    }
    return 1;
}
If you want to see the seconds as well


Re: Pause textlable - Mikkel_RE - 30.07.2012

It works great, thanks alot!