16.11.2010, 19:15
With this code:
Код:
#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; }