What's wrong?
#7

Please try this, little better optimized.
pawn Код:
#include <a_samp>

//AntiCheat
new timer1;

public OnGameModeInit()
{
    timer1 = SetTimer("AntiCheat",5000,true);
    return 1;
}

forward AntiCheat();
public AntiCheat()
{
    new weapon;
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            weapon = GetPlayerWeapon( i );
            if( weapon == 38 || weapon == 35 )
            {
                new string[ 80 ];
                new pName[MAX_PLAYER_NAME];
                GetPlayerName(i, pName, sizeof(pName));
                if( weapon == 38 )
                    format(string, sizeof(string), "%s has been banned. (Reason: AUTO BAN Minigun Cheat)", pName);
                else if( weapon == 35 )
                    format(string, sizeof(string), "%s has been banned (Reason: AUTO BAN Rocket launcher Cheat)", pName);
                   
                SendClientMessageToAll(0xFF0000FF, string);
                BanEx(i, "Auto Ban - Minigun");
                new File:bFile = fopen("autobans.log", io_append);
                if(bFile)
                {
                    fwrite(bFile, "AUTOBANS");
                }
                fclose(bFile);
            }
        }
    }
    return 1;
}

public OnGameModeExit()
{
    KillTimer(timer1);
    return 1;
}
Reply


Messages In This Thread
What's wrong? - by Face9000 - 16.11.2010, 19:15
Re: What's wrong? - by Grim_ - 16.11.2010, 19:19
Re: What's wrong? - by Face9000 - 16.11.2010, 19:34
Re: What's wrong? - by Grim_ - 16.11.2010, 19:39
Re: What's wrong? - by Face9000 - 16.11.2010, 19:41
Re: What's wrong? - by Face9000 - 16.11.2010, 19:50
Re: What's wrong? - by Grim_ - 16.11.2010, 20:00
Re: What's wrong? - by Face9000 - 16.11.2010, 20:04
Re: What's wrong? - by Grim_ - 16.11.2010, 20:08
Re: What's wrong? - by Face9000 - 16.11.2010, 20:09

Forum Jump:


Users browsing this thread: 5 Guest(s)