SA-MP Forums Archive
problem with towing vehicles and gravity?... WTF?.. - 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: problem with towing vehicles and gravity?... WTF?.. (/showthread.php?tid=140099)



problem with towing vehicles and gravity?... WTF?.. - FujiNNN - 07.04.2010

i got that:

pawn Код:
if(PRESSED(LIGHT_KEY)&&(IsPlayerInAnyVehicle(playerid))&&(GetPlayerState(playerid)==PLAYER_STATE_DRIVER))
    {
        if(newcar >= 202 && newcar <= 205)
      {
            new Float:pX,Float:pY,Float:pZ;
            GetPlayerPos(playerid,pX,pY,pZ);
            new Float:vX,Float:vY,Float:vZ;
            new Found=0;
            new vid=0;
            while((vid<MAX_VEHICLES)&&(!Found))
            {
                vid++;
                GetVehiclePos(vid,vX,vY,vZ);
                if((floatabs(pX-vX)<7.0)&&(floatabs(pY-vY)<7.0)&&(floatabs(pZ-vZ)<7.0)&&(vid!=GetPlayerVehicleID(playerid)))
                {
                  Found=1;
                  if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
                    {
                        DetachTrailerFromVehicle(GetPlayerVehicleID(playerid));
                    }
                    AttachTrailerToVehicle(vid,GetPlayerVehicleID(playerid));
                }
            } if(!Found) { }
      }
    }
and when i tow the vehicle everything fine.
AND WHEN I EXIT MY VEHICLE (The Towing Truck) the other vehicle (The Towed Vehicle) is starting to fly like on gravity wtf?...
how do i fix that?.. or it's only me that having that problem?... lol

thanks..