SA-MP Forums Archive
cmd /kill with time - 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)
+--- Thread: cmd /kill with time (/showthread.php?tid=463544)



cmd /kill with time - BoU3A - 12.09.2013

can i do if someone type /kill and try to type it agian after die in same time hes got message like "You can use this cmd after 3:00min"

sorry for my suck english :/


Re: cmd /kill with time - DanishHaq - 12.09.2013

Yes, set a timer... i.e.:

pawn Код:
forward KillCommandTimer(playerid); // at the top
new KillCommand[MAX_PLAYERS]; // still at the top
Below main();

pawn Код:
public KillCommandTimer(playerid)
{
    GameTextForPlayer(playerid, "You can now use /kill again", 3000, 6);
    KillCommand[playerid] = 0;
    return 1;
}
Under the /kill:

pawn Код:
if(KillCommand[playerid] == 1) return SendClientMessage(playerid, 0xFFFFFFFF, "You can only use this command once every 3 minutes.");
SetTimerEx("KillCommandTimer", 180000, false, "i", playerid);
KillCommand[playerid] = 1;



Re: cmd /kill with time - BoU3A - 12.09.2013

Quote:
Originally Posted by DanishHaq
Посмотреть сообщение
Yes, set a timer... i.e.:

pawn Код:
forward KillCommandTimer(playerid); // at the top
new KillCommand[MAX_PLAYERS]; // still at the top
Below main();

pawn Код:
public KillCommandTimer(playerid)
{
    GameTextForPlayer(playerid, "You can now use /kill again", 3000, 6);
    KillCommand[playerid] = 0;
    return 1;
}
Under the /kill:

pawn Код:
if(KillCommand[playerid] == 1) return SendClientMessage(playerid, 0xFFFFFFFF, "You can only use this command once every 3 minutes.");
SetTimerEx("KillCommandTimer", 180000, false, "i", playerid);
KillCommand[playerid] = 1;
Thanks man You always help me +rep