Ghecco

GetSideOfVehicle

Nov 3rd, 2020
189
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. stock GetSideOfVehicle(vehicleid, side, Float:distance, &Float:x, &Float:y, &Float:z, &Float:angle) // Funzione per ottenere il backside di un veicolo
  2. {      
  3.     GetVehiclePos(vehicleid, x, y, z);
  4.     GetVehicleZAngle(vehicleid, angle);
  5.  
  6.     switch(side) // 0 back | 1 front | 2 sx | 3 dx
  7.     {
  8.         case 0: // backside
  9.         {
  10.             x -= (distance * floatsin(-angle, degrees));
  11.             y -= (distance * floatcos(-angle, degrees));
  12.  
  13.             GetVehicleZAngle(vehicleid, angle);
  14.         }
  15.         case 1: // backside
  16.         {
  17.             x -= (distance * floatsin(angle, degrees));
  18.             y -= (distance * floatcos(angle, degrees));
  19.  
  20.             GetVehicleZAngle(vehicleid, angle);
  21.         }
  22.         case 2:
  23.         {
  24.  
  25.             x += (distance * floatsin(-angle-90, degrees));
  26.             y += (distance * floatcos(-angle-90, degrees));
  27.    
  28.         }
  29.           case 3:
  30.         {
  31.            
  32.             x += (distance * floatsin(-angle+90, degrees));
  33.             y += (distance * floatcos(-angle+90, degrees));
  34.  
  35.  
  36.    
  37.         }
  38.     }
  39.     return 1;
  40. }
  41.  
RAW Paste Data