[ajuda/pedido]tempo de guerra
#1

eu pegei um comando de /guerra, e quando criado a gz de guerra, fica 10 minutos rolando antes de terminar a guerra, sу que eu queria que ficasse um contador embaixo do radar, ou enbaixo do dinheiro mostrando quanto tempo falta pra terminar.

Nao precisa dar o code pronto nao, pode falar os principios sу.

o comando й um que eu pegei aki no forum mesmo:
pawn Код:
if(strcmp(cmd,"/guerra", true) == 0)
  {
    if(EmGuerra == 1) return SendClientMessage(playerid,COLOR_GRAD2,"Jб hб uma guerra rolando");//Nao permite 2 guerras de uma vez.
    if(PlayerInfo[playerid][pLider]==3)
    {
 new Float:X,Float:Y,Float:Z;
      GetPlayerPos(playerid, X,Y,Z);
      guerrate = GangZoneCreate(X-100,Y-100,X+100,Y+100);
      GangZoneShowForAll(guerrate,COLOR_GREEN);
      SetTimer("guerrat",600000,false);//nao repete
      new pName[MAX_PLAYER_NAME];
      GetPlayerName(playerid, pName, sizeof(pName));
      format(string, sizeof(string), "O nosso Exйrcito acaba de declarar guerra, nгo se aprуxime da бrea de cor VERDE", pName);
      SendClientMessageToAll(COLOR_GREEN, string);
      EmGuerra = 1;
    }
    if(PlayerInfo[playerid][pLider]==16)
    {
      new Float:X,Float:Y,Float:Z;
      GetPlayerPos(playerid, X,Y,Z);
      guerrate = GangZoneCreate(X-100,Y-100,X+100,Y+100);
      GangZoneShowForAll(guerrate,COLOR_GREEN);
      SetTimer("guerrat",600000,false);//nao repete
      new pName[MAX_PLAYER_NAME];
      GetPlayerName(playerid, pName, sizeof(pName));
      format(string, sizeof(string), "A organizaзгo terrorista Al'Qaeda acaba de declarar guerra, nгo se aprуxime da бrea de cor VERMELHA", pName);
      SendClientMessageToAll(COLOR_ALCAIDA, string);
      EmGuerra = 1;
    }
    if(PlayerInfo[playerid][pLider]==6)
    {
      new Float:X,Float:Y,Float:Z;
      GetPlayerPos(playerid, X,Y,Z);
      guerrate = GangZoneCreate(X-100,Y-100,X+100,Y+100);
      GangZoneShowForAll(guerrate,COLOR_HAMAS);
      SetTimer("guerrat",600000,false);//nao repete
      new pName[MAX_PLAYER_NAME];
      GetPlayerName(playerid, pName, sizeof(pName));
      format(string, sizeof(string), "A organizaзгo terrorista HAMAS acaba de declarar guerra, nгo se aprуxime da бrea de cor Negra", pName);
      SendClientMessageToAll(COLOR_HAMAS, string);
      EmGuerra = 1;
    }
    return 1;
  }
Abraзos
Reply
#2

Coloque isto em baixo de EmGuerra = 1;

pawn Код:
}
    SetTimer("TempoFinalizarGuerra", ------, 0);//No Lugar de ------- Coloque o Tempo que voce deseja
    return 1;
E nas Publics

pawn Код:
}

public TempoFinalizarGuerra()
{
    EmGuerra = 0;
    WinnerGuerra= 0;
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(PlayerGanhou[i] != 0)
            {
                format(string, sizeof(string), "----------------------", pName);//NO LUGAR DE ---------- voce poe quem ganhou (o texto)
                    SendClientMessageToAll(---------, string);//A Cor da ORG QUE GANHOR
            }
        }
        return 1;
}
Espero ter ajudado
Reply
#3

vlw pela ajuda, mais isso eu jб fiz, vocк nao intendeu a pergunta,

eu queria que ficasse embaixo do dinheiro um contador assim:

A guerra termina em: 10:00
9:00
8:00

e assim vai atй 0
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)