[Ajuda] SetTimerEx - string como argumento
#8

Quote:
Originally Posted by leonardo1434
Посмотреть сообщение
PHP код:
CMD:consertar(playerid, params[])
{
    if(!
IsPlayerInAnyVehicle(playerid)) return 0;
    static 
timer;
    if(
timer > gettime()) return SendClientMessage(playerid, COLOR_RED, "[ x ] Vocк ainda nгo pode usar este comando.");
    
//SetVehicleHealth(GetPlayerVehicleID(playerid), 1000.0);
    
    
RepairVehicle(GetPlayerVehicleID(playerid));
    
    
SendClientMessage(playerid, -1, "[>>>] Veнculo consertado!");
    
    
timer = gettime() + 30;
    
    
//SetTimerEx("DelayComandos", 0, false, "ds", playerid, "CMDconsertar");
    
    
DelayComandos(playerid,"CMDconsertar");
    return 
1;
}
forward DelayComandos(playerid, nomevar[]);
public 
DelayComandos(playerid, nomevar[])
{
    
printf(nomevar);
    
    new 
string[145];
    
    
format(string, sizeof string, "[>>>] Vocк jб pode usar o comando %s novamente.", nomevar);
    
    
SendClientMessage(playerid, -1, string);
    
    return 
1;
} 
Desse jeito й bem mais simples e otimizado. Pois nгo usa Pvar e nem pхe o settimer em sleep atй chegar sua vez.
Olб leonardo.
Vocк pode me explicar o jeito que vocк usou o gettime() e a var timer ?

e de qualquer jeito nгo vou ter que usar o SetTimer para nгo executar a funзгo logo apуs executar o comando ?
Reply


Messages In This Thread
SetTimerEx - string como argumento - by retsaoremo - 14.02.2013, 12:48
Re: SetTimerEx - string como argumento - by Maklister - 14.02.2013, 12:55
Re: SetTimerEx - string como argumento - by DouglasRodrigues - 14.02.2013, 13:11
Re: SetTimerEx - string como argumento - by retsaoremo - 14.02.2013, 16:36
Re: SetTimerEx - string como argumento - by retsaoremo - 14.02.2013, 16:47
Re: SetTimerEx - string como argumento - by retsaoremo - 14.02.2013, 17:12
Re: SetTimerEx - string como argumento - by leonardo1434 - 14.02.2013, 17:29
Re: SetTimerEx - string como argumento - by retsaoremo - 15.02.2013, 14:38
Re: SetTimerEx - string como argumento - by leonardo1434 - 15.02.2013, 14:50
Re: SetTimerEx - string como argumento - by retsaoremo - 15.02.2013, 14:55

Forum Jump:


Users browsing this thread: 1 Guest(s)