Textdraw help!
#1

Guys,a little help I need.How to create a Textdraw which counts my time of Checkpoint hunt and when the Checkpoint re-spawns the timer again goes to the 10,i.e., How I show time to player that how much time is left to respawn the CP.
Reply
#2

You could make a timer run in 1 second intervals and change a countdown variable each time and then restart the variables on the limit? If I understand you correctly...
https://sampwiki.blast.hk/wiki/SetTimer
Reply
#3

Nah,you wont understood me.I want to say that "I have a Checkpoint Hunt system.It spawns at different location i have in script.It uses timer to respawn.I want to show That Timer as Textdraw
Reply
#4

B U M P ! ! !
Reply
#5

hmm
https://sampwiki.blast.hk/wiki/TextDrawSetString
and https://sampwiki.blast.hk/wiki/Control_Structures#Loops


pawn Код:
new Text:CooldownText;

public OnGameModeInit()
{
    CooldownText = TextDrawCreate(320.0, 240.0, "Colldown");
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/cd", cmdtext, true, 10) == 0)
    {
        TextDrawShowForPlayer(playerid, CooldownText);
        new a = 20;
        while ( a > -1)
        {
            new newtext[128];
            wait(1);
            format(newtext, sizeof(newtext), "%d, sec", a);
            TextDrawSetString(CooldownText, newtext );
            a--;
        }
        return 1;
    }
    return 0;
}

wait(seconds)
{
    new _newTime[4], _oldTime[4];
    gettime(_oldTime[0], _oldTime[1], _oldTime[2]);
    _oldTime[3] = _oldTime[2] + (_oldTime[1] * 60) + (_oldTime[0] * 600);

    while(_newTime[3] != (_oldTime[3] + seconds))
    {
    gettime(_newTime[0], _newTime[1], _newTime[2]);
    _newTime[3] = _newTime[2] + (_newTime[1] * 60) + (_newTime[0] * 600);
    }
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)