delay command
#1

Helo i try to make an delay to commands but i get this...
PHP Code:
new delay[MAX_PLAYERS];
ptask delaytime[1000](playerid
{
    if(
delay[playerid] != 0)
    {
        
delay[playerid]--;
    }
    return 
1;
}
YCMD:money(playeridparams[], help)
{
    if(
delay[playerid] != 0)
        return 
SendFormatMessage(playerid,-1,"Nu poti sa utilizezi aceasta comanda timp de %i secunde",delay[playerid]);
    
GivePlayerMoney(playeridstrval(params));
    
delay[playerid] = 10;
    return 
1;

Is work great but when i try to use other command who have delay is take the delay from comand [/money]
I wanna that delay to be only to /money not to all comands with delay
PHP Code:
YCMD:buylevel(playeridparams[], help)
{
    if(
delay[playerid] != 0)
    return 
SendFormatMessage(playerid,-1,"[ANTI-SPAM]:Nu poti sa utilizezi aceasta comanda timp de %i secunde",delay[playerid]);
    
// my code...
    
delay[playerid] = 10;
    return 
1;

Reply


Messages In This Thread
delay command - by Calinut200 - 16.05.2020, 18:50
Re: delay command - by Skimmer - 16.05.2020, 19:02

Forum Jump:


Users browsing this thread: 1 Guest(s)