PHP код:
// Topo GM
forward CheckHack();
new HackOxygen[MAX_PLAYERS];
// Dentro da public OnPlayerConnect
HackOxygen[playerid] = 0;
// Dentro da public OnGameModeInit
SetTimer("CheckHack", 3500, true);
// Final do GM fora de qualquer funзгo ou Public
public CheckHack()
{
for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++)//MAX_PLAYERS
{
new Float:pos[3];
GetPlayerPos(i, pos[0], pos[1], pos[2]);
if (pos[2]<-2.0 && IsPlayerInWater(i)) { if(HackOxygen[i] < 9){ HackOxygen[i]++; } }
if (pos[2]>=0.0) { if(HackOxygen[i] > 0){ HackOxygen[i]--; } }
if(HackOxygen[i] >= 9)
{
SendClientMessage(i, -1, "ANTICHEAT: Vocк estб usando Oxigкnio infinito ! ! !");
SetPlayerPos(i,pos[0], pos[1],0.05);
}
}
return 1;
}
stock IsPlayerInWaterLocation(playerid)
{
static Float:fX, Float:fY, Float:fZ; GetPlayerPos(playerid, fX, fY, fZ);
if((fX >= 2044.6 && fX <= 2192.984 && fY >= 1206.358 && fY <= 1376.552) && fZ < 0xA) return 1;
else if((fX >= 2048.504 && fX <= 2185.174 && fY >= 1063.239 && fY <= 1202.49) && fZ < 0xA) return 1;
else if((fX >= 2204.698 && fX <= 2204.698 && fY >= 1426.837 && fY <= 1430.705) && fZ < 0xA) return 1;
else if((fX >= 2032.885 && fX <= 2114.887 && fY >= 1852.325 && fY <= 1991.575) && fZ < 0xC) return 1;
else if((fX >= 2517.086 && fX <= 2606.897 && fY >= 2316.493 && fY <= 2420.93) && fZ < 0x16) return 1;
else if((fX >= 2554.5996 && fX <= 2507.7683 && fY >= 1548.6178 && fY <= 1588.9154) && fZ < 0xF) return 1;
else if((fX >= -2043.628 && fX <= -1973.561 && fY >= -980.9415 && fY <= -724.0283) && fZ < 0x20) return 1;
else if((fX >= -2753.912 && fX <= -2665.071 && fY >= -522.3632 && fY <= -380.3444) && fZ < 0x05) return 1;
else if((fX >= 1219.864 && fX <= 1292.118 && fY >= -2435.881 && fY <= -2325.344) && fZ < 0xF) return 1;
else if((fX >= 1923.388 && fX <= 2010.854 && fY >= -1223.924 && fY <= -1168.656) && fZ < 0x16) return 1;
else if((fX >= 1269.301 && fX <= 1314.935 && fY >= -837.0452 && fY <= -781.7769) && fZ < 0x5A) return 1;
else if((fX >= 1087.3953 && fX <= 1102.3138 && fY >= -682.6734 && fY <= -663.0043) && fZ < 0x71) return 1;
else if((fX >= 1268.6118 && fX <= 1291.8774 && fY >= -784.2910 && fY <= -764.6104) && fZ < 0x43D) return 1;
else if(fZ < 0xF) return 1;
return 0;
}
stock IsPlayerUsingSwimAnim(playerid)
{
if(IsPlayerInAnyVehicle(playerid) || GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return 0;
static animlib[32], animname[32];
GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32);
if(!strcmp(animlib, "SWIM", true) && !strcmp(animname, "SWIM_GLIDE", true)) return 1;
else if(!strcmp(animlib, "SWIM", true) && !strcmp(animname, "SWIM_BREAST", true)) return 1;
else if(!strcmp(animlib, "SWIM", true) && !strcmp(animname, "SWIM_CRAWL", true)) return 1;
else if(!strcmp(animlib, "SWIM", true) && !strcmp(animname, "SWIM_DIVE_UNDER", true)) return 1;
else if(!strcmp(animlib, "SWIM", true) && !strcmp(animname, "SWIM_DIVE_GLIDE", true)) return 1;
else if(!strcmp(animlib, "SWIM", true) && !strcmp(animname, "SWIM_UNDER", true)) return 1;
else if(!strcmp(animlib, "SWIM", true) && !strcmp(animname, "SWIM_TREAD", true)) return 1;
return 0;
}
stock IsPlayerInWater(playerid)
{
if(IsPlayerInWaterLocation(playerid) && IsPlayerUsingSwimAnim(playerid))
{
return 1;
}
return 0;
}
Crйditos funзгo IsPlayerInArea, IsPlayerInWaterLocation e IsPlayerUsingSwimAnim. By Synchro