SA-MP Forums Archive
HALP!!!! - 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: HALP!!!! (/showthread.php?tid=212775)



HALP!!!! - darkknight123 - 17.01.2011

im trying to make a /n or /new for my RP server it works but people can spam it how do i set a 30 second timer on it? this is what i got so far please halp!
Quote:

if(strcmp(cmd, "/n", true) == 0 || strcmp(cmd, "/new", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You havent logged in yet !");
return 1;
}

if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, " You can't speak, you have been silenced !");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/n)ew [Newbie Chat]");
return 1;
}
format(string, sizeof(string), " Player %s: %s " , sendername, result);
OOCOff(0x33CCFFAA,string);
printf("%s", string);
}
return 1;
}




Re: HALP!!!! - MMiz - 17.01.2011

I can't really help you, but i think that you would need to add an /mute system for it.


Re: HALP!!!! - darkknight123 - 17.01.2011

how would i add a /mute system to it?


Re: HALP!!!! - Marricio - 18.01.2011

maybe use a timer