Get vehicle pos fail?
#1

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?
Reply
#2

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.
Reply
#3

aX and so on get there first value in GameModeInit
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)