AntiVehicle Teleport
#1

PHP код:
public OnUnoccupiedVehicleUpdate(vehicleidplayeridpassenger_seatFloat:new_xFloat:new_yFloat:new_zFloat:vel_xFloat:vel_yFloat:vel_z)
{
    if(
GetVehicleDistanceFromPoint(vehicleidnew_xnew_ynew_z) > 35)
    {
        new 
Float:StarXFloat:StarYFloat:StarZ;
        
GetVehiclePos(vehicleidStarXStarYStarZ);
        
SetVehiclePos(vehicleidStarXStarYStarZ);
        return 
0;
    }
    return 
1;

What is wrong O.o ?
Reply
#2

That if-statement can never be true. You need to compare distance to the old position, not the new one.
See example on this page for efficient GetDistanceBetweenPoints.
Reply
#3

http://prntscr.com/7ajr90 lol
Reply
#4

BUmp
Reply
#5

fgfdjgnifjfdigjudfuio BUMPPP
Reply
#6

http://*******/dwoSW3
or
https://sampforum.blast.hk/showthread.php?pid=1832467#pid1832467
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)