High-roller
Join Date: Nov 2011
Location: Brasil
Posts: 3,117
Reputation: 222
|
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.youtube.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!!
__________________
[IMG]https://sites.******.com/site/facesbypaulo/MetropoleGames.png[/IMG] | |
Last edited by paulor; 09/01/2013 at 10:11 PM.
|