I use raven's gamemode and i making anticheat for teleport hack,but i have problem.
i think that is a bad detection how to fix that...
Код:
if(AntiTeleportHack == 1)
{
if(stopforsec[i] == 0)
{
new Float:x3, Float:y3, Float:x2, Float:y2, Float:z2,zone[MAX_ZONE_NAME];
GetPlayerPos(i, x2, y2, z2);
if(IsSpecing[i] == 0)
{
if(IsPlayerInAnyVehicle(i) && (GetPlayerState(i) != PLAYER_STATE_DRIVER))
{
PlayerInfo[i][pPos_x] = x2;
PlayerInfo[i][pPos_y] = y2;
PlayerInfo[i][pPos_z] = z2;
}
x3 = PlayerInfo[i][pPos_x];
y3 = PlayerInfo[i][pPos_y];
if(!IsAtTransfender(i))
{
if((x2 - x3)+(y2 - y3) >= 250 || (x3 - x2)+(y3 - y2) >=250
|| (x2 - x3)+(y3 - y2) >= 250 || (x3 - x2)+(y2 - y3) >=250)
{
GetPlayer2DZone(i, zone, MAX_ZONE_NAME);
AddPunishment(i, string);
format(string,sizeof(string),"{FF6347}[AntiCheat]: {FFFFFF}%s vjerovatno koristi {FF6347}Teleport Hack{FFFFFF} (%s)",sendername, zone);
SendGmMessage(COLOR_WHITE, string);
PlayerInfo[i][pPos_x] = x2;
PlayerInfo[i][pPos_y] = y2;
PlayerInfo[i][pPos_z] = z2;
new playersip[64];
new giveplayerid, giveplayer[MAX_PLAYER_NAME],result[64],playerid;
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(i,sendername,sizeof(sendername));
GetPlayerIp(giveplayerid,playersip,sizeof(playersip));
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s je banovan od strane Anticheata zbog: Teleport Hacka",d,m,y,h,mi,s,giveplayer,sendername, (result));
BanLog(string);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] banovan od strane Anticheata - Razlog: Teleport Hacka",d,m,y,h,mi,s,sendername,(result));
AddPunishment(giveplayerid, string);
format(string, sizeof(string), "%s (%d), je banovan od strane Anticheata zbog Teleport Hacka", giveplayer, giveplayerid, sendername, (result));
SendClientMessageToAll(COLOR_NICERED, string);
format(string, sizeof(string), "[Anticheat]: %s je dodat u ban listu od strane Anticheata", playersip, sendername);
SendGmMessage(COLOR_NICERED, string);
SCM(i,COLOR_WHITE, "{FF6347}[Anticheat]{FFFFFF}Banovani ste od strane Anti Cheat-a zbog {FF6347}Teleport Hacka{FFFFFF}.");
SCM(i,COLOR_WHITE, "{FF6347}[Anticheat]{FFFFFF}Ako mislite da je ovo greska stisnite {FF6347}F8 {FFFFFF}i postavi sliku na {FF6347}forum{FFFFFF}.");
SCM(i,COLOR_WHITE, "{FF6347}[Anticheat]{FFFFFF}________________{FF6347}Adresa Foruma: {FFFFFF}www.ultimate-evolution{FF6347}.info{FFFFFF}________________");
format(string,sizeof(string), "{FF6347}[Anticheat]{FFFFFF} Datum: {FF6347}%d.%d.%d. {FFFFFF}Vreme: {FF6347}%d:%d:%d",d,m,y,h,mi,s);
SCM(i,COLOR_WHITE, string);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d][Anticheat] Banovan od strane Anti Cheat-a zbog Teleport Hacka.",d,m,y,h,mi,s);
AddPunishment(i, string);
new rand = random(sizeof(gPrisonSpawn));
SafeSetPlayerPos(i, gPrisonSpawn[rand][0], gPrisonSpawn[rand][1], gPrisonSpawn[rand][2]);
SetPlayerSkin(i, 252);
SafeSetPlayerInterior(i, 1);
PlayerInfo[i][pJailed] = 1;
PlayerInfo[i][pJailTime] += 240;
PlayerInfo[i][pBanned] = 1;
ScriptBan(i,i,reason);
MaxBans[i] += 1;
Kick(i);
}
else
{
PlayerInfo[i][pPos_x] = x2;
PlayerInfo[i][pPos_y] = y2;
PlayerInfo[i][pPos_z] = z2;
}
}
}
else
{
PlayerInfo[i][pPos_x] = x2;
PlayerInfo[i][pPos_y] = y2;
PlayerInfo[i][pPos_z] = z2;
}
}
}
}
else
{
new Float:x2, Float:y2, Float:z2;
GetPlayerPos(i, x2, y2, z2);
PlayerInfo[i][pPos_x] = x2;
PlayerInfo[i][pPos_y] = y2;
PlayerInfo[i][pPos_z] = z2;
}
}
}
else
{
new Float:x2, Float:y2, Float:z2;
GetPlayerPos(i, x2, y2, z2);
PlayerInfo[i][pPos_x] = x2;
PlayerInfo[i][pPos_y] = y2;
PlayerInfo[i][pPos_z] = z2;
}
}
}
}
return 1;
}