SA-MP Forums Archive
AntiVehicle Teleport - 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)
+--- Thread: AntiVehicle Teleport (/showthread.php?tid=575651)



AntiVehicle Teleport - ilepopivanov - 28.05.2015

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 ?


Re: AntiVehicle Teleport - Vince - 28.05.2015

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.


Re: AntiVehicle Teleport - ilepopivanov - 28.05.2015

http://prntscr.com/7ajr90 lol


Re: AntiVehicle Teleport - ilepopivanov - 29.05.2015

BUmp


Re: AntiVehicle Teleport - ilepopivanov - 30.05.2015

fgfdjgnifjfdigjudfuio BUMPPP


Respuesta: AntiVehicle Teleport - AndreLuiz - 31.05.2015

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