Jump to content
  • 0

Anti spam


TheGodfather

Question

Salut, as vrea sa pun pe serverul meu un sistem de anti spam care sa fie pentru char, indiferent ca e doar scris sau comenzi. Am facut un timer doar ca indiferent ce as scrie imi tot spune ca trebuie sa astept 3 secunde chiar daca nu am mai scris nicio comanda pana atunci.

Link to comment
Share on other sites

Recommended Posts

  • 0
#define MAX_COMMANDS_ALLOWED_SEC	5 // commands
#define MAX_COMMANDS_ALLOWED_TIME 	1 // secounds
new commandused[MAX_PLAYERS]=0;

public OnPlayerText(playerid, text[])
{
	commandused[playerid]++;
	if(commandused[playerid] > MAX_COMMANDS_ALLOWED_SEC) {
		SCMT(COLOR_WARNING,"SERVER: %s a primit kick (posibil spam).",GetName(playerid));
		KickEx(playerid);
		return 0;
	}
	SetTimerEx("resetCommands", MAX_COMMANDS_ALLOWED_TIME*1000, 0, "i", playerid);
	return 0;
}
function resetCommands(playerid) return commandused[playerid]=0;

 

aqpUjAc.png

 

 

 

 

Link to comment
Share on other sites

  • 0
Acum 5 ore, nobilzeusAdv a spus:

#define MAX_COMMANDS_ALLOWED_SEC	5 // commands
#define MAX_COMMANDS_ALLOWED_TIME 	1 // secounds
new commandused[MAX_PLAYERS]=0;

public OnPlayerText(playerid, text[])
{
	commandused[playerid]++;
	if(commandused[playerid] > MAX_COMMANDS_ALLOWED_SEC) {
		SCMT(COLOR_WARNING,"SERVER: %s a primit kick (posibil spam).",GetName(playerid));
		KickEx(playerid);
		return 0;
	}
	SetTimerEx("resetCommands", MAX_COMMANDS_ALLOWED_TIME*1000, 0, "i", playerid);
	return 0;
}
function resetCommands(playerid) return commandused[playerid]=0;

 

Nu se intampla nimic, am pus ce ai pus si tu inafara de acel kickex, iar in loc de acel SCMT am pus SCMf(playerid, COLOR_WARNING,"SERVER: %s a primit kick (posibil spam).",GetName(playerid));

Link to comment
Share on other sites

  • 0
Acum 4 ore, TheGodfather a spus:

Nu se intampla nimic, am pus ce ai pus si tu inafara de acel kickex, iar in loc de acel SCMT am pus SCMf(playerid, COLOR_WARNING,"SERVER: %s a primit kick (posibil spam).",GetName(playerid));

Acolo este pt 5 comenzi pe secundă făcut, modifica max_commands_sec 5 cu 1

aqpUjAc.png

 

 

 

 

Link to comment
Share on other sites

  • 0

Dupa cum am explicat, daca nu iti functioneaza performed-ul, incearca pawn cmd, trecerea e rapida, in loc de CMD devine cmd si atat, iar la prescurtari e alias, nu ai cum sa ai 600 de comenzi intr-un gm, aproximativ 60-90 maxim de comenzi sunt pentru admini, iar restul pana-n 300-400 dar e mult 400 chiar si 300 sunt pentru jucatori in general, ai notepad++ / sublime text, trecerea e foarte usoara fata de pawno pentru ca acolo ai mai putine oportunitati de modificare

Link to comment
Share on other sites

  • 0
Acum 14 minute, iSkull a spus:

Dupa cum am explicat, daca nu iti functioneaza performed-ul, incearca pawn cmd, trecerea e rapida, in loc de CMD devine cmd si atat, iar la prescurtari e alias, nu ai cum sa ai 600 de comenzi intr-un gm, aproximativ 60-90 maxim de comenzi sunt pentru admini, iar restul pana-n 300-400 dar e mult 400 chiar si 300 sunt pentru jucatori in general, ai notepad++ / sublime text, trecerea e foarte usoara fata de pawno pentru ca acolo ai mai putine oportunitati de modificare

Sunt 631 mai exact, am pus tot gmul in notepad++, ctrl+f, ycmd: dupa find all in current document si sunt 631

Link to comment
Share on other sites

  • 0
Chiar acum, TheGodfather a spus:

Sunt 631 mai exact, am pus tot gmul in notepad++, ctrl+f, ycmd: dupa find all in current document si sunt 631

Acolo ai si prescurtari, dupa cum am spus mai sus, se poate modifica usor de la zcmd/ycmd la pawn cmd sau invers, doar ca la ycmd ai acel help in plus, in rest nimic

Link to comment
Share on other sites

  • 0
Acum 6 ore, TheGodfather a spus:

La comenzi separate daca pun verificare merge, ca am incercat la una. Da pana pun la 600... De asta vreau sa vad daca se poate pune ceva pe la alta functie

poti pune la cele importante, nu ai cum altfel decat sa incerci pe pawncmd

Link to comment
Share on other sites

  • 0
Acum 43 minute, hanako a spus:

poti pune la cele importante, nu ai cum altfel decat sa incerci pe pawncmd

Am pus la fiecare separat, cu notepad++ am dat insert all sau cum se numeste optiune, gen sa imi pune dupa fiecare nume de comanda

Link to comment
Share on other sites

  • 0
Acum 1 oră, TheGodfather a spus:

Am pus la fiecare separat, cu notepad++ am dat insert all sau cum se numeste optiune, gen sa imi pune dupa fiecare nume de comanda

ok, si ti-a mers? daca da, ar trebui topic closed

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.