16.11.2010, 19:39
If I told you indenting wouldn't hurt, would you believe me?
You didn't end your timer function before starting the OnGameModeExit callback.
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;
}