Jump to content

GvaKO

Recommended Posts

C , ako spravim anti prikaz spam .. Furt na servery niekto dava nap warp /lv a dookola a zaspamuje cely chat chcel by som aby ked hned zasebou napise dvakrat napr tak mu to napise -> Antispam prikaz kazde 2 sekundy .. A po 2 sekundach mu to zase pojde ten prikaz

Link to comment
Share on other sites

nahoru:

 

new antispam[MAX_PLAYERS];
forward spam(playerid);

 

do OnPlayerCommandText dáš:

 

if(antispam[playerid] == 0)
{
antispam[playerid] =1;
SetTimerEx("spam", 2000, 0, "i", playerid);
} else SendClientMessage(playerid,-1,"Jeden příkaz za 2 sekundy");

 

a pak někam:

 

public spam(playerid)
{
antispam[playerid] =0;
return 1;
}

Link to comment
Share on other sites

Dej toto nahoru, jako první do publicu OnPlayerCommandText. Musí to jet už.

 

if(antispam[playerid] == 1)
{
SendClientMessage(playerid,-1,"Jeden příkaz za 2 sekundy");
return 1;
}
antispam[playerid] =1;
SetTimerEx("spam", 2000, 0, "i", playerid);

 

Omlouvám se, ale u mého předchozího příspěvku není tlačítko upravit.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...