Testdraw countdown help?
#5

Quote:
Originally Posted by vvhy
Посмотреть сообщение
game text makes people lag when its a countdown, I've tried it
Try this one then. Just created for you [UNTESTED]
pawn Код:
//Countdown
forward CountDown(playerid, seconds);
public CountDown(playerid, seconds)
{
    new string[50];
    if(seconds > 0)
    {
            new Text:TextdrawCT;
        new Float:X, Float:Y, Float:Z;
        GetPlayerPos(playerid, X, Y, Z);
        format(string, sizeof(string), "~R~%d", seconds);
            TextdrawCT = TextDrawCreate(262.000000, 163.000000, "string");
        TextDrawBackgroundColor(Textdraw0, 255);
        TextDrawFont(Textdraw0, 1);
        TextDrawLetterSize(Textdraw0, 0.500000, 1.000000);
        TextDrawColor(Textdraw0, -16776961);
        TextDrawSetOutline(Textdraw0, 0);
        TextDrawSetProportional(Textdraw0, 1);
        TextDrawSetShadow(Textdraw0, 1);
        PlayerPlaySound(playerid, 1056, X, Y, Z);
        TextDrawShowForPlayer(playerid,TextdrawCT);
        seconds = seconds -1;
        SetTimerEx("CountDown", 1000, 0, "ii", playerid, seconds);
        return 1;
    }
    if(seconds == 0)
    {
            new Text:TextdrawCT1;
        new Float:X, Float:Y, Float:Z;
        GetPlayerPos(playerid, X, Y, Z);
        PlayerPlaySound(playerid, 1057, X, Y, Z);
            TextdrawCT = TextDrawCreate(262.000000, 163.000000, "GO..");
        TextDrawBackgroundColor(Textdraw0, 255);
        TextDrawFont(Textdraw0, 1);
        TextDrawLetterSize(Textdraw0, 0.500000, 1.000000);
        TextDrawColor(Textdraw0, -16776961);
        TextDrawSetOutline(Textdraw0, 0);
        TextDrawSetProportional(Textdraw0, 1);
        TextDrawSetShadow(Textdraw0, 1);
        TogglePlayerControllable(playerid, 1);
        return 1;
    }
    return 1;
}
Reply


Messages In This Thread
Testdraw countdown help? - by vvhy - 23.04.2012, 01:22
Re: Testdraw countdown help? - by MP2 - 23.04.2012, 01:26
Re: Testdraw countdown help? - by Ballu Miaa - 23.04.2012, 01:38
Re: Testdraw countdown help? - by vvhy - 23.04.2012, 01:42
Re: Testdraw countdown help? - by Ballu Miaa - 23.04.2012, 02:14

Forum Jump:


Users browsing this thread: 1 Guest(s)