15.06.2010, 10:30
ah yes forgot:
In onplayerconnect:
disconnect:
public:
btw: i don't do a for loop in my public (i = max_players etc), because i got many problems with this
In onplayerconnect:
Code:
WeaponTimer[playerid] = SetTimerEx("WeaponHack", 1000, true, "d",playerid);
Code:
KillTimer(WeaponTimer[playerid]);
pawn Code:
forward WeaponHack(playerid);
public WeaponHack(playerid)
{
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1) return 0;
new string[128];
new w7;
new a7;
new day,month,year,hour,minute;
new ip[256];
for(new i; i < 13; i++)
{
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;
}
}
return 0;
}