[Pedido] Tempo do Roubo
#1

queria um negocio que quando digitar /roubar em um local de roubo, vai aparecer o tempo na tela diminuindo,atй o fim do roubo. Por exemplo: quando eu dou /roubar comeзa a aparecer o tempo que falta para terminar.


Obrigado.

pawn Код:
if(ProvocoBanco[playerid] == 1)
    {
        //SendClientMessageToAll(COLOR_WHITE, "(=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=({FFD700}Assalto ao Banco{BFC0C2})=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=)");
        format(gstring, sizeof(gstring), "%s e os %s nгo conseguiram roubar o cofre do Banco ! ID:[%d]", PlayerName(playerid), NomeORG(playerid) , playerid);
        SendClientMessageToAll(GetPlayerColor(playerid), gstring);
        ClearAnimations(playerid);
        KillTimer(RoubarThiagoAnim);
        ProvocoBanco[playerid] = 0; roubando[playerid] = 0; roubobanco = 0; KillTimer(tempobanco); temporoubobanco = 0;
    }
pawn Код:
if(strcmp(cmd,"/roubar",true)==0)
    {
        if(PlayerInfo[playerid][pMembro] != 5 && PlayerInfo[playerid][pLider] != 5
        && PlayerInfo[playerid][pMembro] != 14 && PlayerInfo[playerid][pLider] != 14
        && PlayerInfo[playerid][pMembro] != 17 && PlayerInfo[playerid][pLider] != 17
        && PlayerInfo[playerid][pMembro] != 18 && PlayerInfo[playerid][pLider] != 18
        && PlayerInfo[playerid][pMembro] != 19 && PlayerInfo[playerid][pLider] != 19
        && PlayerInfo[playerid][pMembro] != 20 && PlayerInfo[playerid][pLider] != 20
        && PlayerInfo[playerid][pMembro] != 21 && PlayerInfo[playerid][pLider] != 21
        && PlayerInfo[playerid][pLider] != 24
        && GetPlayerOrg(playerid) != 6 && GetPlayerOrg(playerid) != 12
        && GetPlayerOrg(playerid) != 13 && GetPlayerOrg(playerid) != 15)
        {
            SendClientMessage(playerid,COLOR_GREY,"Vocк nгo pode assaltar !");
            return true;
        }
        if(roubando[playerid] == 1)
        {
            SendClientMessage(playerid, COLOR_GRAD5, "Vocк ja estб roubando algum lugar.");
            return true;
        }
        if(PlayerToPoint(2.0,playerid, 2144.4177,1641.5360,993.5761))
        {
            if(roubobanco == 1)
            {
                SendClientMessage(playerid, COLOR_GRAD5, "Jб estб tendo uma tentativa de roubo nesse cofre.");
                return true;
            }
            if(temporoubobanco == 1)
            {
                SendClientMessage(playerid,COLOR_GREY,"Jб roubaram o cofre do banco espere 3 minutos para roubar de novo !");
                return true;
            }
            GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
            //SendClientMessageToAll(COLOR_WHITE, "(=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=({FFD700}Assalto ao Banco{BFC0C2})=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=)");
            format(string, sizeof(string), "%s e os %s estгo tentando roubar o cofre banco! ID:[%d]", playername, NomeORG(playerid) , playerid);
            SendClientMessageToAll(GetPlayerColor(playerid), string);
            SendClientMessage(playerid, COLOR_GRAD5, "Espere 40 segundos para terminar de roubar o banco.");
            SetPlayerCriminal(playerid,255, "Tentativa de Roubo ao Banco");
            CreateExplosion(2306.5127,-6.1166,26.7422, 12, 10.0); // Ira criar uma explosгo exatamente no lugar que o player digitou para roubar
            roubando[playerid] = 1;
            ProvocoBanco[playerid] = 1;
            roubobanco = 1;
            temporoubobanco = 1;
            Controle(playerid, 0);
            SetPlayerPos(playerid, 2144.3711,1641.4792,993.5761);
            SetPlayerFacingAngle(playerid,1.2666);
            SetTimer("Aroubo", 220000, 0);
            RoubarThiagoAnim = SetTimerEx("AnimRouboBanco", 900, 0, "i", playerid);
            tempobanco = SetTimerEx("RouboBanco", 40000, 0, "i", playerid);
            SetPlayerAttachedObject(playerid, 0, 1550, 1, 0.000000, -0.313611, 0.021003, 0.445490, 86.754409, 355.370239, 0.926815, 1.000000, 1.000000);
            SetTimerEx("AcabarMochila", 120000, 0, "i", playerid);
            return true;
        }
Reply
#2

o unico modo que sei й vc ter q criar assim :

Inicio do GM:
pawn Код:
forward Um();
forward Dois();
forward Tres();
... Todos atй o tempo de roubo total
Qualquer parte :
pawn Код:
public Um()
{
        for(new i = 0; i < MAX_PLAYERS; i++)
    {
        GameTextForPlayer(i, "~r~1",2000,3);
        }
    return 1;
}
public Dois()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        GameTextForPlayer(i, "~r~2",2000,3);
        }
    return 1;
}
public Tres()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        GameTextForPlayer(i, "~r~3",2000,3);
        }
    return 1;
}
... Todos atй o tempo de roubo total
No Comando
pawn Код:
SetTimer("Um", 1000, 0);
SetTimer("dois", 2000, 0);
SetTimer("Tres", 3000, 0);
... Todos atй o tempo de roubo total
P.S:Ficou tudo "bagunзado" ai pq fiz qui pelo forum n pelo pawno
Reply
#3

Aqui funcionou, muito obrigado Felipe_Freeze ! +rep
Reply
#4

Muito Obrigado!
A muito tempo que procuro por isto!

Felipe_Freeze Sabes me dizer como colocar sу para o Jogador que esta a roubar?
Reply
#5

Se alguйm souber de como arranjar isso!
PF me ajude! +rep para quem ajudar!
Reply
#6

Quote:
Originally Posted by HaLoCiNoGeN
Посмотреть сообщение
Muito Obrigado!
A muito tempo que procuro por isto!

Felipe_Freeze Sabes me dizer como colocar sу para o Jogador que esta a roubar?
Se й GameTextForPlayer

Ou seja para o Player que esta fazendo a aзгo nй ?
Reply
#7

Quote:
Originally Posted by Felipe_Freeze
Посмотреть сообщение
o unico modo que sei й vc ter q criar assim :

Inicio do GM:
pawn Код:
forward Um();
forward Dois();
forward Tres();
... Todos atй o tempo de roubo total
Qualquer parte :
pawn Код:
public Um()
{
        for(new i = 0; i < MAX_PLAYERS; i++)
    {
        GameTextForPlayer(i, "~r~1",2000,3);
        }
    return 1;
}
public Dois()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        GameTextForPlayer(i, "~r~2",2000,3);
        }
    return 1;
}
public Tres()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        GameTextForPlayer(i, "~r~3",2000,3);
        }
    return 1;
}
... Todos atй o tempo de roubo total
No Comando
pawn Код:
SetTimer("Um", 1000, 0);
SetTimer("dois", 2000, 0);
SetTimer("Tres", 3000, 0);
... Todos atй o tempo de roubo total
P.S:Ficou tudo "bagunзado" ai pq fiz qui pelo forum n pelo pawno
LOOOL.

Para que criar tanta public e timer?

Com 1 public + 1 timer,da para fazer..
Reply
#8

Devia ser mas da para toda gente no server!
Reply
#9

Simples.

Topo do GM
pawn Код:
forward CountTime(playerid);
Fim do GM
pawn Код:
public CountTime(playerid){
    new time = 3,_string[18],_time;
    if(time == 0)
        GameTextForPlayer(playerid,"0!",3000,1),time = 3,KillTimer(_time);
    else {
        format(_string, sizeof(_string), "%d", time);
            GameTextForPlayer(playerid, _string, 3000, 1);
    }
    return _time = SetTimerEx("CountTime",1000,1,"d",playerid);
}
No comando

pawn Код:
SetTimerEx("CountTime",1000,0,"d",playerid);
Reply
#10

Este CODE do BlueX Lagg muito o meu servidor na hora de roubar!
E muito Bom e simples de usar mas da muita lagg!
Mesmo assim muito Obrigado!


Quote:
Originally Posted by BlueX
Посмотреть сообщение
Simples.

Topo do GM
pawn Код:
forward CountTime(playerid);
Fim do GM
pawn Код:
public CountTime(playerid){
    new time = 3,_string[18],_time;
    if(time == 0)
        GameTextForPlayer(playerid,"0!",3000,1),time = 3,KillTimer(_time);
    else {
        format(_string, sizeof(_string), "%d", time);
            GameTextForPlayer(playerid, _string, 3000, 1);
    }
    return _time = SetTimerEx("CountTime",1000,1,"d",playerid);
}
No comando

pawn Код:
SetTimerEx("CountTime",1000,0,"d",playerid);
Jб este CODE do Felipe_Freeze nгo da lagg nenhuma!
Se alguйm souber como por este CODE sу para o jogador que esta a roubar!
E me puder ajudar Agradecia muito!



Quote:
Originally Posted by Felipe_Freeze
Посмотреть сообщение
o unico modo que sei й vc ter q criar assim :

Inicio do GM:
pawn Код:
forward Um();
forward Dois();
forward Tres();
... Todos atй o tempo de roubo total
Qualquer parte :
pawn Код:
public Um()
{
        for(new i = 0; i < MAX_PLAYERS; i++)
    {
        GameTextForPlayer(i, "~r~1",2000,3);
        }
    return 1;
}
public Dois()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        GameTextForPlayer(i, "~r~2",2000,3);
        }
    return 1;
}
public Tres()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        GameTextForPlayer(i, "~r~3",2000,3);
        }
    return 1;
}
... Todos atй o tempo de roubo total
No Comando
pawn Код:
SetTimer("Um", 1000, 0);
SetTimer("dois", 2000, 0);
SetTimer("Tres", 3000, 0);
... Todos atй o tempo de roubo total
P.S:Ficou tudo "bagunзado" ai pq fiz qui pelo forum n pelo pawno
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)