20.07.2009, 04:12
Is There Anything so if like a command or message is been typed more than twice in a row the 3rd time it will say stop spamming
but i need it so commands cant be spammed
dose anyone no one please? thanks for helping.


new SpamCheck[MAX_PLAYERS];
//OnGameModeInit: SetTimer("AntiSpam",5000,1); // occurs every 5 seconds
//OnPlayerCommandText: SpamCheck[playerid] ++; // and to stop the spam: if(SpamCheck[playerid] > 5) { SendClientMessage(playerid, COLOR, "DONT SPAM!!!!"); return 0; }
//OnPlayerText: SpamCheck[playerid] ++; if(SpamCheck[playerid] > 5) { SendClientMessage(playerid, COLOR, "DONT SPAM!!!!"); return 0; }
public AntiSpam() { for(new i=0; i<MAX_PLAYERS; i++) { SpamCheck[playerid] --; } }
Originally Posted by <__Ǝthan__>
make a var indexed to every player, for example:
Код:
new SpamCheck[MAX_PLAYERS]; Код:
//OnGameModeInit: SetTimer("AntiSpam",5000,1); // occurs every 5 seconds Код:
//OnPlayerCommandText: SpamCheck[playerid] ++; // and to stop the spam: if(SpamCheck[playerid] > 5) { SendClientMessage(playerid, COLOR, "DONT SPAM!!!!"); return 0; } Код:
//OnPlayerText: SpamCheck[playerid] ++; if(SpamCheck[playerid] > 5) { SendClientMessage(playerid, COLOR, "DONT SPAM!!!!"); return 0; } Код:
public AntiSpam() { for(new i=0; i<MAX_PLAYERS; i++) { SpamCheck[playerid] --; } } you can of curse change it to how you want. |