Advertisement
Luk4s

[FNC] GetVehicleInfo

Jan 26th, 2013
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.98 KB | None | 0 0
  1. native IsValidVehicle(vehicleid);
  2.  
  3. stock GetVehicleInfo(vehicleid, infotype, &Float:x, &Float:y, &Float:z, &Float:angle) // by Kar
  4. {
  5.     if(!IsValidVehicle(vehicleid)) return 0;
  6.     new Float:mX, Float:mY, Float:mZ;
  7.     GetVehicleModelInfo(GetVehicleModel(vehicleid), infotype, mX, mY, mZ);
  8.     z += mZ;
  9.     x += (mY * floatsin(-angle, degrees));
  10.     y += (mY * floatcos(-angle, degrees));
  11.    
  12.     angle += 270.0;
  13.     x += (mX * floatsin(-angle, degrees));
  14.     y += (mX * floatcos(-angle, degrees));
  15.     angle -= 270.0;
  16.     return 1;
  17. }
  18.  
  19. // PAVYZDYS
  20. COMMAND:cap(playerid)
  21. {
  22.     new Float:Pos[4];
  23.     for(new v = 0; v < MAX_VEHICLES; v++)
  24.     {
  25.         GetVehiclePos(v, Pos[0], Pos[1], Pos[2]); GetVehicleZAngle(v, Pos[3]);
  26.         GetVehicleInfo(v, VEHICLE_MODEL_INFO_PETROLCAP, Pos[0], Pos[1], Pos[2], Pos[3]);
  27.  
  28.         if(IsPlayerInRangeOfPoint(playerid, 1.0, Pos[0], Pos[1], Pos[2]))
  29.             {
  30.             return SendClientMessage(playerid, -1, " - Esate šalia transp. priem. kuro bako");
  31.         }
  32.     }
  33.     return 1;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement