[Tutorial] Criando ProgressBar By. Paulo
#1

Minha 1° Video Aula para o Forum SA-MP.

Nгo tem muito o que falar, vejam o Video e Comentem!!


[ame]http://www.youtube.com/watch?v=eMCuNJBgg6E[/ame]

pawn Код:
#define pSpeed 100 //Velocidade da Barra em Ms
new Text: pTd[3];

public OnGameModeInit() {
    SetGameModeText("Blank Script");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
   
    pTd[0] = TextDrawCreate(38.000000, 320.000000, "_"); //Fundo Preto
    TextDrawLetterSize(pTd[0], 0.500000, 1.100000);
    TextDrawUseBox(pTd[0], 1);
    TextDrawBoxColor(pTd[0], 255);
    TextDrawTextSize(pTd[0], 142.000000, 0.000000);

    pTd[1] = TextDrawCreate(39.000000, 322.000000, "_"); //Fundo da Progress
    TextDrawLetterSize(pTd[1], 0.500000, 0.699999);
    TextDrawUseBox(pTd[1], 1);
    TextDrawBoxColor(pTd[1], (0x99 | (~0xFF & 0xFF0000FF)));
    TextDrawTextSize(pTd[1], 141.000000, 0.000000);

    pTd[2] = TextDrawCreate(39.000000, 322.000000, "_"); //Progress
    TextDrawLetterSize(pTd[2], 0.500000, 0.699999);
    TextDrawUseBox(pTd[2], 1);
    TextDrawBoxColor(pTd[2], 0xFF0000FF);
    TextDrawTextSize(pTd[2], 36.000000, 0.000000); //102px
    return 1;
}

forward ProgrecoBar(playerid);
public ProgrecoBar(playerid) {
    static Float: Progress;
    TextDrawTextSize(pTd[2], (39.0 + ((102.0 * ++Progress) / 100)), 0.0);
    TextDrawShowForPlayer(playerid, pTd[2]);
    if(Progress < 100.0) SetTimerEx("ProgrecoBar", pSpeed, false, "i", playerid);
    //else - Terminou o Progresso.
    return 1;
}

public OnPlayerConnect(playerid) {
    TextDrawShowForPlayer(playerid, pTd[0]);
    TextDrawShowForPlayer(playerid, pTd[1]);
    TextDrawShowForPlayer(playerid, pTd[2]);
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[]) {
    if(!strcmp("/iniciar", cmdtext)) {
        SetTimerEx("ProgrecoBar", pSpeed, false, "i", playerid);
        SendClientMessage(playerid, -1, "Progresso Iniciado!!");
        return 1;
    }
    return 0;
}
Espero que Gostem!!
Reply


Messages In This Thread
Criando ProgressBar By. Paulo - by paulor - 09.01.2013, 16:54
Re: Criando ProgressBar By. Paulo - by SeV_ - 09.01.2013, 17:01
Re: Criando ProgressBar By. Paulo - by paulor - 09.01.2013, 17:03
Re: Criando ProgressBar By. Paulo - by DiReCt hIt - 09.01.2013, 17:21
Re: Criando ProgressBar By. Paulo - by Wendell - 09.01.2013, 17:22
Re: Criando ProgressBar By. Paulo - by zSuYaNw - 09.01.2013, 17:26
Re: Criando ProgressBar By. Paulo - by paulor - 09.01.2013, 17:28
Respuesta: Criando ProgressBar By. Paulo - by WCrimson - 09.01.2013, 17:56
Re: Criando ProgressBar By. Paulo - by MegaStyle157 - 09.01.2013, 17:59
Re: Criando ProgressBar By. Paulo - by Gii - 09.01.2013, 18:02

Forum Jump:


Users browsing this thread: 1 Guest(s)