Check Position bugged
#1

I'm trying to make a ANTI Teleport Hack, but i got some problems

It's so simple, get player position, after sometime check if player is in a valid range
If this range is so high and player was not teleported for a server command (SetPlayerPosEx)
It punish the teleport hack

But i'm stuck in the part to if player use server command, dont detect was a hacker

The values here:
Код:
format(string, sizeof(string), "Xtp[%i], Ytp[%i], Ztp[%i]", Xtp[playerid], Ytp[playerid], Ztp[playerid] );
Should be (i used /save in the same place i've got this string /\ ):
Код:
-25.3970,-185.8796,1003.5469
But instead of it, its showing:
Код:
[05:50:29] Xtp[-1043649266], Ytp[-1019616979], Ztp[1148904192]
Full code:
Код:
stock SetPlayerPosEx(playerid,Float:x,Float:y,Float:z,Float:angle,int,vw, bool:carregar = false) {
    // update anti TP (to dont detect)
    Xtp[playerid] = x;
    Ytp[playerid] = y;
    Ztp[playerid] = z;
    INTtp[playerid] = int;
    VWtp[playerid] = vw;
    // 
    SetPlayerInterior(playerid,int);
    SetPlayerVirtualWorld(playerid, vw);
    SetPlayerPos(playerid, x,y,z);
    if(angle == 0) SetCameraBehindPlayer(playerid);
    if(carregar == true) PlayerCarregando(playerid);
    // active anti TP
    ContadorTeleport[playerid] = SetTimerEx("DetectTeleport", 50, false, "i", playerid);
    return 1;
}
forward CheckTeleport(playerid); public CheckTeleport(playerid) {
    KillTimer(ContadorTeleport[playerid]);
    if(IsPlayerConnected(playerid) && playerid != INVALID_PLAYER_ID) {
        GetPlayerPos(playerid, Xtp[playerid], Ytp[playerid], Ztp[playerid]);
        INTtp[playerid] = GetPlayerInterior(playerid);
        VWtp[playerid] = GetPlayerVirtualWorld(playerid);
        ContadorTeleport[playerid] = SetTimerEx("DetectTeleport", 500, false, "i", playerid);
    }
}
forward DetectTeleport(playerid); public DetectTeleport(playerid) {
    KillTimer(ContadorTeleport[playerid]);
    if(gSpectateID[playerid] == 65535 && paused[playerid] == false) {
        if(!IsPlayerInRangeOfPoint(playerid, 60.0, Xtp[playerid], Ytp[playerid], Ztp[playerid])) {
            new string[128];
            format(string, sizeof(string), "Xtp[%i], Ytp[%i], Ztp[%i]", Xtp[playerid], Ytp[playerid], Ztp[playerid] );
            ABroadCast(-1,string,3);
            format(string, sizeof(string), "HACK: %s TELEPORT", PlayerName(playerid) );
            ABroadCast(-1,string,3);
            SetPlayerPosEx(playerid, Xtp[playerid], Ytp[playerid], Ztp[playerid], 0, INTtp[playerid], VWtp[playerid]);
        }
    }
    ContadorTeleport[playerid] = SetTimerEx("CheckTeleport", 500, false, "i", playerid);
}
What do i doing wrong?
Reply


Messages In This Thread
Check Position bugged - by binnyl - 24.06.2018, 09:08
Re: Check Position bugged - by binnyl - 24.06.2018, 19:43
Re: Check Position bugged - by Sew_Sumi - 24.06.2018, 22:46
Re: Check Position bugged - by binnyl - 25.06.2018, 01:14
Re: Check Position bugged - by Sew_Sumi - 25.06.2018, 01:18
Re: Check Position bugged - by binnyl - 25.06.2018, 04:09
Re: Check Position bugged - by Exhibit - 25.06.2018, 05:03
Re: Check Position bugged - by Sew_Sumi - 25.06.2018, 09:04
Re: Check Position bugged - by maikons - 25.06.2018, 14:29
Re: Check Position bugged - by Sew_Sumi - 25.06.2018, 14:32

Forum Jump:


Users browsing this thread: 1 Guest(s)