Two commands - 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: Two commands (
/showthread.php?tid=612695)
Two commands -
BrianS123 - 20.07.2016
I need /ad command with timer to avoid spam, please..
i really don't know how to use timer..
and if possible a (/stat [playername]) for admins to see offline players's stats
i'm using INI and i have a login/register system, just give me an example and i'll edit the reset.
Re: Two commands -
Codeah - 20.07.2016
To start a timer for a specific user use SetTimerEx
For Example:
Quote:
//At the top of your script below includes
forward adtimer(playerid);
new avoidspam[MAX_PLAYERS];
//Inside Command (I used ZCMD)
CMD:ad(playerid, params[])
{
new adformat[32];
SetTimerEx("adtimer", 30000, false, "i", playerid);
avoidspam[playerid] = true;
format(adformat, sizeof(adformat), "Advertisment : %s", input[]);
SendClientMessageToAll(-1, adformat);
}
//The public
public adtimer(playerid)
{
avoidspam[playerid] = false;
return 1;
}
|
I havent tested it, but you get the point. Its pretty simple
Re: Two commands -
BrianS123 - 21.07.2016
ow thanks!