SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Português/Portuguese > Lançamentos/Releases

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 09/01/2013, 04:54 PM   #1
paulor
High-roller
 
Join Date: Nov 2011
Location: Brasil
Posts: 3,117
Reputation: 222
Default Criando ProgressBar By. Paulo

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

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


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

pawn Code:
#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!!
__________________
Meus Projetos - contato@paulorwd.com.br
[IMG]https://sites.******.com/site/facesbypaulo/MetropoleGames.png[/IMG]

Last edited by paulor; 09/01/2013 at 09:11 PM.
paulor is offline   Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Map] San Paulo (New City) rokki Maps 52 09/12/2013 04:15 PM


All times are GMT. The time now is 01:15 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.