10.02.2015, 16:41
I created this fast, correct my mistakes (brackets etc..)
pawn Код:
SetTimer("AntiCheatUpdate",2000,1); // OnGameModeInit
forward AntiCheatUpdate();
public AntiCheatUpdate()
{
foreach(Player,i)
{
new Float:Armour;
GetPlayerArmour(i,Armour);
new a[16];
GetPlayerIp(i, a, sizeof(a));
new year, month, day, hour, minuite, second;
getdate(year, month, day);
gettime(hour,minuite,second);
if(Player[i][pAdmin] < 1 )
{
if(Armour > 99.0 && hacker[i] == 0){
SCM(i, COLOR_YELLOW, "You have been banned from the server. Reason: Armour Hack");
format(Message,sizeof(Message),"SERVER : %s has been banned from the server. Reason: Armour Hack <Date: %d/%d/%d> <Time: %d:%d>",GetName(i),day,month,year,hour,minuite);
SCMToAll(COLOR_KRED,Message);
format(Message,sizeof(Message),"SERVER : %s and his ip %s",GetName(i),a);
SaveIn("BanLog.txt",Message);
hacker[i] =1;
SetTimerEx("Banned",10,false,"d", i);
return 1;
}
if(GetPlayerAnimationIndex(i))
{
new animlib[32], animname[32]; GetAnimationName(GetPlayerAnimationIndex(i), animlib, sizeof(animlib), animname, sizeof(animname));
if(!strcmp(animlib, "PARACHUTE", true) && !strcmp(animname, "FALL_SkyDive_Accel", true))
{
if(GetPlayerWeapon(i) != 46 && hacker[i] == 0)
{
SCM(i, COLOR_YELLOW, "You have been banned from the server. Reason: Fly Hack");
format(Message,sizeof(Message),"SERVER : %s has been banned from the server. Reason: Fly Hack <Date: %d/%d/%d> <Time: %d:%d>",GetName(i),day,month,year,hour,minuite);
SCMToAll(COLOR_KRED,Message);
format(Message,sizeof(Message),"SERVER : %s and his ip %s",GetName(i),a);
SaveIn("BanLog.txt",Message);
hacker[i] =1;
SetTimerEx("Banned",10,false,"d", i);
return 1;
}
}
}
if(GetPlayerState(i) == PLAYER_STATE_DRIVER && hacker[i] == 0)
{
if(GetVehicleSpeed(GetPlayerVehicleID(i)) > 250 && !IsVehicleFLYVehicle(GetPlayerVehicleID(i)))
{
SCM(i, COLOR_YELLOW, "You have been Kicked from the server. Reason: Sobiet Speed Hack");
format(Message,sizeof(Message),"SERVER : %s has been kick from the server. Reason: Speed Hack <Date: %d/%d/%d> <Time: %d:%d>",GetName(i),day,month,year,hour,minuite);
SCMToAll(COLOR_KRED,Message);
format(Message,sizeof(Message),"SERVER : %s and his ip %s",GetName(i),a);
SaveIn("BanLog.txt",Message);
hacker[i] =1;
SetTimerEx("KickPlayer",10,false,"d", i);
return 1;
}
}
new Float:Pos_x,Float:Pos_y,Float:Pos_z;
new anim = GetPlayerAnimationIndex(i);
GetPlayerVelocity(i,Pos_x,Pos_y,Pos_z);
if((Pos_x <= -0.800000 || Pos_y <= -0.800000 || Pos_z <= -0.800000) && (anim == 1008 || anim == 1539))
{
if(hacker[i] == 0)
{
SCM(i, COLOR_YELLOW, "You have been banned from the server. Reason: Sobiet Fly Hack");
format(Message,sizeof(Message),"SERVER : %s has been banned from the server. Reason: Sobiet fly Hack <Date: %d/%d/%d> <Time: %d:%d>",GetName(i),day,month,year,hour,minuite);
SCMToAll(COLOR_KRED,Message);
format(Message,sizeof(Message),"SERVER : %s and his ip %s",GetName(i),a);
SaveIn("BanLog.txt",Message);
hacker[i] =1;
SetTimerEx("Banned",10,false,"d", i);
}
}
}
return 1;
}