[AJUDA] Fazendo um timer com TextDraw
#9

Quote:
Originally Posted by s4kuL
Посмотреть сообщение
Nгo testei.

pawn Код:
new Text:Contagem;
new TimerContagem;
new TempoDaContagem = 10;

public OnGameModeInit()
{
    Contagem = TextDrawCreate(300, 300, "_");
    TextDrawFont(Contagem , 1);
    TextDrawLetterSize(Contagem , 2, 14);
    TextDrawColor(Contagem , -1);
    TextDrawSetOutline(Contagem , 0);
    TextDrawSetProportional(Contagem , 1);
    TextDrawSetShadow(Contagem , 0);

    return true;
}

CMD:iniciarcontagem(playerid)
{
    SendClientMessage(playerid, -1, "Contagem de 10 segundos inciada!");
   
    TextDrawShowForAll(Contagem);
    TimerContagem = SetTimer("Timer", 1000, true);
    return 1;
}

forward Timer();
public Timer()
{
    TempoDaContagem --;
   
    new String[2];
    format(String,sizeof(string),"%d",TempoDaContagem);
    TextDrawSetString(Contagem, String);
   
    if(TempoDaContagem == 0)
    {
        TempoDaContagem = 10;
        KillTimer(TimerContagem);
        TextDrawHideForAll(Contagem);
    }
    return 1;
}
Mas й mais ou menos assim..
Tem um erro no seu forward.. na linha do format, colocou o string com letra minъscula..

PHP код:
    format(String,sizeof(String),"%d",TempoDaContagem); 
Reply


Messages In This Thread
[AJUDA] Fazendo um timer com TextDraw - by pi - 22.07.2011, 19:15
Re: [AJUDA] Fazendo um timer com TextDraw - by RockFire - 22.07.2011, 19:19
Re: [AJUDA] Fazendo um timer com TextDraw - by pi - 22.07.2011, 19:45
Re: [AJUDA] Fazendo um timer com TextDraw - by Shadoww5 - 22.07.2011, 21:55
Re: [AJUDA] Fazendo um timer com TextDraw - by s4kuL - 13.10.2016, 22:13
Re: [AJUDA] Fazendo um timer com TextDraw - by FalcaoNC - 13.10.2016, 22:14
Re: [AJUDA] Fazendo um timer com TextDraw - by s4kuL - 13.10.2016, 22:20
Re: [AJUDA] Fazendo um timer com TextDraw - by FalcaoNC - 13.10.2016, 22:21
Re: [AJUDA] Fazendo um timer com TextDraw - by CrowleyNWD - 14.10.2016, 20:20
Re: [AJUDA] Fazendo um timer com TextDraw - by RedMF - 14.10.2016, 21:55

Forum Jump:


Users browsing this thread: 1 Guest(s)