What's wrong?
#4

If I told you indenting wouldn't hurt, would you believe me?

pawn Код:
#include <a_samp>
#include <dini>

//AntiCheat
new timer1;

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

forward AntiCheat();
public AntiCheat()
{
    new weap, ammo;
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            GetPlayerWeaponData(i, 7, weap, ammo);
            if(weap == 38)
            {
                new string [128];
                new pName[MAX_PLAYER_NAME];
                GetPlayerName(i, pName, sizeof(pName));
                format(string, sizeof(string), "%s has been banned. (Reason: AUTO BAN Minigun 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);
            }
            break;
        }
        GetPlayerWeaponData(i, 7, weap, ammo);
        if(weap == 35)
        {
            new string [128];
            new pName[MAX_PLAYER_NAME];
            GetPlayerName(i, pName, sizeof(pName));
            format(string, sizeof(string), "%s has been banned (Reason: AUTO BAN Rocket launcher Cheat)", pName);
            SendClientMessageToAll(0xFF0000FF, string);
            BanEx(i, "Auto Ban - Rocket Launcher");
            new File:bFile = fopen("autobans.log", io_append);
            if(bFile)
            {
                fwrite(bFile, "AUTOBANS");
            }
            fclose(bFile);
        }
        break;
    }
}

public OnGameModeExit()
{
    KillTimer(timer1);
    return 1;
}
You didn't end your timer function before starting the OnGameModeExit callback.
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: 4 Guest(s)