[Ajuda] Setar determinado tempo!
#1

Olб,

Primeiramente Boa Noite, Ontem mesmo criei um comando, No qual faz o veiculo ficar blindado (indestrutнvel).
Sу que eu quero isso:
Ao usar o comando /blindar seta um tempo determinado para acabar a Blindagem e ficar normal, Й possнvel? Se sim oque usar? : P

pawn Код:
if( !strcmp( cmd, "/blindar", true ))
    {
        if( !IsPlayerInAnyVehicle( playerid ))
        {
             SendClientMessage( playerid, COLOR_ERRO, "[ x ] Vocк nгo estб em um veнculo !" );
             return 1;
        }
        if( !PlayerToPoint( 1.1, playerid,1911.1052,-1776.7916,13.0881 ))
        {
            new
                v = GetPlayerVehicleID( playerid )
            ;
            SetVehicleHealth( v, 1000 );
            RepairVehicle( v );
            TempoAutoReparar = SetTimerEx("AutoReparar", 200, true, "i", playerid);
            Ativado[playerid] = 1;
            SendClientMessage(playerid, 0xDFDFDFAA, "{B0C4DE}[ - ] Vocк agora estб usando Blindagem!.");
            SendClientMessage(playerid, COLOR_ERRO, "[ - ] Avise um Administrador para evitar transtornos!");
            return 1;
        }
        if( pInfo[ playerid ][ Level ] <= 10 )
        {
            SendClientMessage( playerid, COLOR_ERRO, "[ x ] Vocк nгo tem level o suficiente ! ( Somente level superior a 10 )" );
            return 1;
        }
        if( GetPlayerCash( playerid ) < 20000 )
        {
            SendClientMessage( playerid, COLOR_ERRO, "[ x ] Vocк nгo tem dinheiro o suficiente ! {FFFFFF}( Preзo {009900}$20.000 {FFFFFF} )" );
            return 1;
        }
        return 1;
    }
Reply
#2

sу nгo acredito que criou esse comando e nгo sabia como colocar um tempo.

pawn Код:
SetTimer
Reply
#3

Ta ai у.

pawn Код:
if( !strcmp( cmd, "/blindar", true ))
{
    if( !IsPlayerInAnyVehicle( playerid ))
    {
         SendClientMessage( playerid, COLOR_ERRO, "[ x ] Vocк nгo estб em um veнculo !" );
         return 1;
    }
    if( !PlayerToPoint( 1.1, playerid,1911.1052,-1776.7916,13.0881 ))
    {
        new
            v = GetPlayerVehicleID( playerid )
        ;
        SetVehicleHealth( v, 1000 );
        RepairVehicle( v );
        TempoAutoReparar = SetTimerEx("AutoReparar", 200, true, "i", playerid);
        Ativado[playerid] = 1;
        SendClientMessage(playerid, 0xDFDFDFAA, "{B0C4DE}[ - ] Vocк agora estб usando Blindagem!.");
        SendClientMessage(playerid, COLOR_ERRO, "[ - ] Avise um Administrador para evitar transtornos!");
        SetTimer("unblindar", 5000, false); //o 5000 representa o tempo em mili-segundos no caso estб 5 segundos!
        return 1;
    }
    if( pInfo[ playerid ][ Level ] <= 10 )
    {
        SendClientMessage( playerid, COLOR_ERRO, "[ x ] Vocк nгo tem level o suficiente ! ( Somente level superior a 10 )" );
        return 1;
    }
    if( GetPlayerCash( playerid ) < 20000 )
    {
        SendClientMessage( playerid, COLOR_ERRO, "[ x ] Vocк nгo tem dinheiro o suficiente ! {FFFFFF}( Preзo {009900}$20.000 {FFFFFF} )" );
        return 1;
    }
    return 1;
}
forward unblindar();
public unblindar()
{
    SetVehicleHealth( v, 100 );
    //Aqui coloca oque quer que mostre tudo quando tirar a blindagem!
}
Obs: Nгo testei, mas acho que estб certo!
Reply
#4

Quote:
Originally Posted by DannielCooper
Посмотреть сообщение
sу nгo acredito que criou esse comando e nгo sabia como colocar um tempo.

pawn Код:
SetTimer
Eu sabia б vбriavel amigo!
Sу nгo sabia como acrescentar o forward
Nгo fale oque nгo saiba!
Atй +
GC
Reply
#5

Quote:
Originally Posted by ThuuGLif3
Посмотреть сообщение
Eu sabia б vбriavel amigo!
Sу nгo sabia como acrescentar o forward
Nгo fale oque nгo saiba!
Atй +
GC
variбvel? WTF?

usava stock.
Reply
#6

Quote:
Originally Posted by ThuuGLif3
Посмотреть сообщение
Eu sabia б vбriavel amigo!
Sу nгo sabia como acrescentar o forward
Nгo fale oque nгo saiba!
Atй +
GC
Funciounou ou nгo?
Reply
#7

SetTimer ? :O
Creio que o certo para a situaзгo й o SetTimerEx
sem o SetTimerEx nгo й possivel adicionar parametros.

https://sampwiki.blast.hk/wiki/SetTimerEx
Reply
#8

SetTimer pra esse tipo de funзгo acho que vai bugar.
Reply
#9

Quote:
Originally Posted by DanDRT
Посмотреть сообщение
SetTimer ? :O
Creio que o certo para a situaзгo й o SetTimerEx
sem o SetTimerEx nгo й possivel adicionar parametros.

https://sampwiki.blast.hk/wiki/SetTimerEx
Quote:
Originally Posted by Eudes
Посмотреть сообщение
SetTimer pra esse tipo de funзгo acho que vai bugar.
E o pior й que o cara nгo fala se funfo se n funfo!

e ainda nгo diz nem Obrigado pela ajuda, depois querem reclamar que ninguйm mais ajuda.
Reply
#10

Quote:
Originally Posted by ViniKuliveguisky
Посмотреть сообщение
E o pior й que o cara nгo fala se funfo se n funfo!

e ainda nгo diz nem Obrigado pela ajuda, depois querem reclamar que ninguйm mais ajuda.
NГO! NГO! Adiantou! Feliz? ^^
Obrigado e blablabla, E eu nгo reclamo que ninguem ajuda!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)