15.06.2010, 11:23
Quote:
Originally Posted by DJDhan
You are sending playerid and then scanning all players
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 i; i < 13; i++) { if(IsPlayerAdmin(i) || PlayerInfo[i][pAdmin] > 0) return 0; GetPlayerWeaponData(playerid, i, w7, a7); if(w7 == 38 && a7 >= 1) { GetPlayerIp(playerid,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(playerid,_COLOR_RED," "); SendClientMessage(playerid,_COLOR_RED," "); SendClientMessage(playerid,_COLOR_RED,"You was banned from this server!"); SendClientMessage(playerid,_COLOR_WHITE,"Reason: Minigun"); SendClientMessage(playerid,_COLOR_WHITE,"Admin: Anti-Cheat"); format(string2, sizeof(string2), "Date: %d/%d/%d",day,month,year); SendClientMessage(playerid,_COLOR_WHITE,string); if (minute <= 9) { format(string,25,"Time: %d:0%d",hour,minute); SendClientMessage(playerid,_COLOR_WHITE,string); } else { format(string,25,"Time: %d:%d",hour,minute); SendClientMessage(playerid,_COLOR_WHITE,string); } format(string, sizeof(string), "IP: %s",ip); SendClientMessage(playerid,_COLOR_WHITE,string; if(LoggedIn[playerid] == 1) dUserSetINT(PlayerName(playerid)).("Banned",1); WriteBanToFile(playerid, "Anti-Cheat", "Minigun"); BanEx(playerid,"Minigun"); } } return 1; } |
This code is wrong...
also i would be 13 players and playerid is missing.
my code is ok, the i isnt for the players, its for the weapon slots -_-