23.11.2018, 15:53
(
Последний раз редактировалось RiqueP; 23.11.2018 в 17:43.
)
PHP код:
new Float:AntigaPos[MAX_PLAYERS][2];
public OnGameModeInit() {
SetTimer("AntiTeleporte", 500, true);
return 1;
}
forward AntiTeleporte();
public AntiTeleporte() {
new Float:pos[3];
for(new playerid = 0; playerid < MAX_PLAYERS; ++playerid) {
if(IsPlayerConnected(playerid)) {
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
if(GetPlayerDistanceFromPoint(playerid, AntigaPos[playerid][0], AntigaPos[playerid][1], pos[2]) > /* Tamanho do Hipotйtico Circulo */) {
// Й hacker
}
else {
AntigaPos[playerid][0] = pos[0];
AntigaPos[playerid][1] = pos[1];
}
}
}
return 1;
}
stock SetPlayerPosEx(playerid, Float:x, Float:y, Float:z) {
AntigaPos[playerid][0] = x;
AntigaPos[playerid][1] = y;
return SetPlayerPos(playerid, x, y, z);
}