• 04 Juin 2026, 15:33:47


Auteur Sujet: Problème Anti-Flood  (Lu 859 fois)

0 Membres et 1 Invité sur ce sujet

Hors ligne Komolos

  • *
  • Tueur en série
  • Messages: 190
    • Voir le profil
Problème Anti-Flood
« le: 02 Octobre 2010, 13:54:00 »
Bonjour,
Aujourd'hui j'ai essaillé de scripter un anti flood, mais je n'arrive pas à le faire marché il me marque des erreur :'(

public  OnPlayerTeamPrivmsg( playerid, text[] )
{
//       assert( AntiFlood_Check( playerid ) );

        return 1;
}

AntiFlood_Check( playerid, bool:inc=true )
{
        AntiFlood_Data[playerid][floodRate] += inc ? RATE_INC : 0;
        AntiFlood_Data[playerid][floodRate]  = AntiFlood_Data[playerid][floodRate] - ( GetTickCount() - AntiFlood_Data[playerid][lastCheck] );
        AntiFlood_Data[playerid][lastCheck]  = GetTickCount();
        AntiFlood_Data[playerid][floodRate]  = AntiFlood_Data[playerid][floodRate] < 0 ? 0 : AntiFlood_Data[playerid][floodRate];

        if ( AntiFlood_Data[playerid][floodRate] >= RATE_MAX )
        {
                if THRESOLD_ACTION == 1
                        new string[256];
new sendername[MAX_PLAYER_NAME];

                        GetPlayerName( playerid, name, sizeof( name ) );

                        format(string, sizeof(string), "[Auto-Kick]: %s a été Banni (Raison: Flood).", sendername );

                        SendClientMessageToAll(COLOR_LIGHTRED, string);

                        Ban(playerid);
                         }
                     else if THRESOLD_ACTION == 2
                     {
                        //new msg[64],
new name[MAX_PLAYER_NAME];

                        GetPlayerName( playerid, name, sizeof (name));

                        format(string, sizeof(string), "[Anti-Flood]: %s a été Kicker (Raison: Flood).", sendername );

                        SendClientMessageToAll(COLOR_LIGHTRED,string);

                        Kick(playerid);
                        else
                        SendClientMessage( playerid,COLOR_RED, "Vous flood/spam le serveur, arrêtez ou vous serrez kicker !" );
                //#endif

                return false;
        }

        return true;
}


C:\Users\Administrator\Desktop\Street City 0.3b\gamemodes\street.pwn(52247) : warning 203: symbol is never used: "AntiFlood_Check"
C:\Users\Administrator\Desktop\Street City 0.3b\gamemodes\street.pwn(52247) : warning 203: symbol is never used: "Turfs"

la ligne 52247 ses la fin du gm :s