Need help with Chatbox [ READ 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)
+--- Thread: Need help with Chatbox [ READ Please!! ] (
/showthread.php?tid=342899)
Need help with Chatbot [ READ Please!! ] -
Neonwalker - 15.05.2012
ok,so i got a chatbot.
from. here.
http://pastebin.com/M4BQDt7k
When i say something like...
hi , bot replies but when i say like 5 times hi, then he says 5 times the message..
so it can be abused with spam...
Can anyone edit that pastebin or tell me how to make it like this:
Example i say 5 times hi and she replys only after maybe 20 sec ?
Re: Need help with Chatbox [ READ Please!! ] -
Neonwalker - 16.05.2012
any1?
Re: Need help with Chatbox [ READ Please!! ] -
Lorenc_ - 16.05.2012
Try this:
pawn Код:
new p_AntiSpam[ MAX_PLAYERS ];
public OnPlayerText(playerid, text[])
{
if( ( ( GetTickCount( ) - p_AntiSpam[ playerid ] ) > 20000 )
{
if(!strcmp(text, "Ha", true) || !strcmp(text, "lol", true) || !strcmp(text, "rofl", true) || !strcmp(text, "lmao", true))
{
SendPlayerMessageToAll(playerid, text);
SendBotMessage("ROFL - COPTER");
p_AntiSpam[ playerid ] = GetTickCount( );
return 0;
}
if(!strcmp(text, "Hi", true) || !strcmp(text, "Sup", true) || !strcmp(text, "Sophie", true) || !strcmp(text, "Hiya", true))
{
SendPlayerMessageToAll(playerid, text);
Random(playerid);
p_AntiSpam[ playerid ] = GetTickCount( );
return 0;
}
}
return 1;
}