SA-MP Forums Archive
/n chat help please - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /n chat help please (/showthread.php?tid=212666)



/n chat help please - darkknight123 - 17.01.2011

name says it all, im working on a rp server but need help makeing a /n command that the player has to wait 30 seconds to use again unless they are a helper please help


Re: /n chat help please - WillyP - 17.01.2011

pawn Код:
new W30SEC;

CMD:n(playerid,params[])
{
    if(GetPVarInt("UsedCmd" == 1))
    {
        SendClientMessage(playerid,-1,"Wait! N00B!");
    }
    SetPVarInt("UsedCmd",1);
    W30SEC = SetTimer("Wait",30000,true);
    SendClientMessage(playerid,-1,"Yay, it r work!");
    return 1;
}

forward Wait();
public Wait()
{
    SetPVarInt("USedCmd",0);
    KillTimer(W30SEC);
    return 1;
}
Might work, I just did this quickly.


Re: /n chat help please - Alex_Valde - 17.01.2011

SetTimer will make it globally. Use SetTimerEx instead if you want to make timer for only one player.