SA-MP Forums Archive
Get vehicle pos fail? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Get vehicle pos fail? (/showthread.php?tid=170194)



Get vehicle pos fail? - whitedragon - 22.08.2010

i make antihack but it say that i'm hacking all time.
pawn Код:
public AntiHack()
{
    new Float:aX,Float:aY,Float:aZ;
    new Float:a2X,Float:a2Y,Float:a2Z;
   
    for(new r=0;r<= MAX_PLAYERS;r++)
    {
        new PState = GetPlayerState(r);
        if (PState == PLAYER_STATE_DRIVER)
        {
            new m = GetPlayerVehicleID(r);
            GetVehiclePos(m,a2X,a2Y,a2Z);
            if((floatabs(aX-a2X)>1.0)&&(floatabs(aY-a2Y)>1.0)&&(floatabs(aZ-a2Z)>1.0) && gCar[auto2][Engine] == 0)
            {
                SetVehiclePos(m,aX,aY,aZ);
                SendClientMessage(r, COLOR_GREY, "No HACK!!!");
            }
            GetVehiclePos(m,aX,aY,aZ);
        }
    }
    return 1;
}
but i just enter vehicle and i hack.... How to fix it?


Re: Get vehicle pos fail? - dax123 - 22.08.2010

Quote:
Originally Posted by whitedragon
Посмотреть сообщение
i make antihack but it say that i'm hacking all time.
pawn Код:
public AntiHack()
{
    new Float:aX,Float:aY,Float:aZ;
    new Float:a2X,Float:a2Y,Float:a2Z;
   
    for(new r=0;r<= MAX_PLAYERS;r++)
    {
        new PState = GetPlayerState(r);
        if (PState == PLAYER_STATE_DRIVER)
        {
            new m = GetPlayerVehicleID(r);
            GetVehiclePos(m,a2X,a2Y,a2Z);
            if((floatabs(aX-a2X)>1.0)&&(floatabs(aY-a2Y)>1.0)&&(floatabs(aZ-a2Z)>1.0) && gCar[auto2][Engine] == 0)
            {
                SetVehiclePos(m,aX,aY,aZ);
                SendClientMessage(r, COLOR_GREY, "No HACK!!!");
            }
            GetVehiclePos(m,aX,aY,aZ);
        }
    }
    return 1;
}
but i just enter vehicle and i hack.... How to fix it?
you didn't do anything with aX,Float:aY,Float:aZ, so these values are not properly initialized for checking.


Re: Get vehicle pos fail? - whitedragon - 22.08.2010

aX and so on get there first value in GameModeInit