15.06.2010, 11:02
You are sending playerid and then scanning all players
Put this at the Top somewhere
Put this under OnGameModeInit()
Put this at the Top somewhere
Code:
new weaponhacktimer;
Code:
weaponhacktimer = SetTimer("WeaponHack", 1000, true);
Code:
forward WeaponHack(); public WeaponHack() { new string[128]; new w7; new a7; new day,month,year,hour,minute; new ip[256]; for(new j=0; j < MAX_PLAYERS; j++) { if(IsPlayerAdmin(j) || PlayerInfo[j][pAdmin] > 0) return 0; for(new i=0;i<13,i++) { GetPlayerWeaponData(j, i, w7, a7); if(w7 == 38 && a7 >= 1) { GetPlayerIp(j,ip,sizeof(ip)); getdate(year,month,day); gettime(hour,minute); format(string, sizeof(string), "%s was banned from the server. [Reason: Minigun]", PlayerName(playerid)); SendClientMessageToAll(_COLOR_RED, string); SendClientMessage(j,_COLOR_RED," "); SendClientMessage(j,_COLOR_RED," "); SendClientMessage(j,_COLOR_RED,"You was banned from this server!"); SendClientMessage(j,_COLOR_WHITE,"Reason: Minigun"); SendClientMessage(j,_COLOR_WHITE,"Admin: Anti-Cheat"); format(string2, sizeof(string2), "Date: %d/%d/%d",day,month,year); SendClientMessage(j,_COLOR_WHITE,string); if (minute <= 9) { format(string,25,"Time: %d:0%d",hour,minute); SendClientMessage(j,_COLOR_WHITE,string); } else { format(string,25,"Time: %d:%d",hour,minute); SendClientMessage(j,_COLOR_WHITE,string); } format(string, sizeof(string), "IP: %s",ip); SendClientMessage(j,_COLOR_WHITE,string; if(LoggedIn[j] == 1) dUserSetINT(PlayerName(playerid)).("Banned",1); WriteBanToFile(j, "Anti-Cheat", "Minigun"); BanEx(j,"Minigun"); } } } return 1; }