Aai amigo peguei um fs que eu tinha aqui agora й so vocк adapta-lo a seu jeito.
pawn Код:
#include <a_samp>
#define BOMBATEMPO 4 // O Tempo que levarб para a bomba explodir (em segundos).
#define ARMARTEMPO 0 // O Tempo que levarб para armar a bomba (em segundos).
#define Amarelo 0xFFFF00AA
new MS[MAX_PLAYERS];
new Segundos[MAX_PLAYERS];
new Minutos[MAX_PLAYERS];
new bombplanttime;
new bombtime;
new PlantouBomba[MAX_PLAYERS];
new Text:Contagem;
forward BombTime(playerid);
forward BombPlantTime(playerid);
//-----------------------------------------------------------------------------------------------------------------//
public OnFilterScriptInit()
{
Contagem = TextDrawCreate(51.000000, 316.000000, "00:00:00");
TextDrawBackgroundColor(Contagem, 255);
TextDrawFont(Contagem, 2);
TextDrawLetterSize(Contagem, 0.500000, 2.199999);
TextDrawColor(Contagem, -1);
TextDrawSetOutline(Contagem, 1);
TextDrawSetProportional(Contagem, 1);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/contar", true) == 0)
{
if(PlantouBomba[playerid] == 1) return SendClientMessage(playerid, Amarelo, "Vocк iniciou a contagem. ");
else
{
bombplanttime = SetTimerEx("BombPlantTime", ARMARTEMPO*1000, 0, "d", playerid);
PlantouBomba[playerid] = 1;
TextDrawShowForPlayer(playerid, Contagem);
return 1;
}
}
return 0;
}
public BombPlantTime(playerid)
{
TogglePlayerControllable(playerid, 1);
bombtime = SetTimerEx("BombTime", 9, 1, "d", playerid);
MS[playerid] = 99;
Segundos[playerid] = BOMBATEMPO;
TextDrawShowForAll(Text:Contagem);
KillTimer(bombplanttime);
return 1;
}
public BombTime(playerid)
{
MS[playerid]--;
if(MS[playerid] == 0)
{
MS[playerid] = 99;
Segundos[playerid]--;
}
if(Segundos[playerid] > 60)
{
new Segundos2 = Segundos[playerid] - 60;
Segundos[playerid] = Segundos2;
Minutos[playerid]++;
}
if(Segundos[playerid] == 0 && Minutos[playerid] > 0)
{
Segundos[playerid] = 59;
Minutos[playerid]--;
}
if(Segundos[playerid] == 0 && MS[playerid] == 1)
{
PlantouBomba[playerid] = 0;
TextDrawHideForAll(Text:Contagem);
GameTextForAll("~g~~h~Vai Vai Vai",2500,3);
KillTimer(bombtime);
}
if(Segundos[playerid] < 10)
{
new count[10];
format(count, sizeof(count), "00:0%i:%i", Segundos[playerid], MS[playerid]);
TextDrawSetString(Contagem, count);
}
if(Segundos[playerid] >= 10)
{
new count[10];
format(count, sizeof(count), "00:%i:%i", Segundos[playerid], MS[playerid]);
TextDrawSetString(Contagem, count);
}
if(Minutos[playerid] < 10 && Segundos[playerid] < 10)
{
new count[10];
format(count, sizeof(count), "0%i:0%i:%i",Minutos[playerid], Segundos[playerid], MS[playerid]);
TextDrawSetString(Contagem, count);
}
if(Minutos[playerid] < 10 && Segundos[playerid] > 9)
{
new count[10];
format(count, sizeof(count), "0%i:%i:%i",Minutos[playerid], Segundos[playerid], MS[playerid]);
TextDrawSetString(Contagem, count);
}
if(Minutos[playerid] >= 10 && Segundos[playerid] > 9)
{
new count[10];
format(count, sizeof(count), "%i:%i:%i",Minutos[playerid], Segundos[playerid], MS[playerid]);
TextDrawSetString(Contagem, count);
}
if(Minutos[playerid] >= 10 && Segundos[playerid] < 10)
{
new count[10];
format(count, sizeof(count), "%i:0%i:%i",Minutos[playerid], Segundos[playerid], MS[playerid]);
TextDrawSetString(Contagem, count);
}
return 1;
}