Advertisement
Guest User

Untitled

a guest
Feb 15th, 2017
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 5.90 KB | None | 0 0
  1.     for(new i=0; i<SLOTS; i++)
  2.     {
  3.         new vehid = GetPlayerVehicleID(i);
  4.         new vehmodel = GetVehicleModel(vehid);
  5.         new engine, lights, alarm, doors, bonnet, boot, objective;
  6.         GetVehicleParamsEx(vehid, engine, lights, alarm, doors, bonnet, boot, objective);
  7.         if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i) && !IsANoTachoVehicle(vehid))
  8.         {
  9.             for(new x = 0; x < MaxVeh; x++)
  10.             {
  11.                 GetPlayerPos(i, Speedo_X, Speedo_Y, Speedo_Z);
  12.                 GetVehicleHealth(vehid, Speedo_HP);
  13.                 new str1[256],str2[256],str3[256],str4[256];
  14.                 if(SpeedoON[i] == 0)
  15.                 {
  16.                     TextDrawShowForPlayer(i, box[i]); TextDrawShowForPlayer(i, fahrzeug[i]); TextDrawShowForPlayer(i, kmh[i]);
  17.                     TextDrawShowForPlayer(i, hoehe[i]); TextDrawShowForPlayer(i, zustand[i]); TextDrawShowForPlayer(i, kilometer[i]);
  18.                     SpeedoON[i] = 1;
  19.                 }
  20.                 new Float:speed_x,Float:speed_y,Float:speed_z,Float:final_speed,final_speed_int;
  21.                 GetVehicleVelocity(vehid, speed_x, speed_y, speed_z);
  22.                 final_speed = floatsqroot(((speed_x*speed_x)+(speed_y*speed_y))+(speed_z*speed_z))*120.0; // 136.666667 = kmph  // 85.4166672= mph
  23.                 final_speed_int = floatround(final_speed,floatround_round);
  24.                 new kmh_anzahl = final_speed_int;
  25.                 format(str1,sizeof(str1),"Fahrzeug: ~y~%s",VehicleName[GetVehicleModel(GetPlayerVehicleID(i))-400]);
  26.                 TextDrawSetString(fahrzeug[i], str1);
  27.                 if(kmh_anzahl >= 150)
  28.                 {
  29.                     format(str2,sizeof(str2),"KM/H: ~r~%d",kmh_anzahl);
  30.                     TextDrawSetString(kmh[i], str2);
  31.                 }
  32.                 else if(kmh_anzahl >= 100)
  33.                 {
  34.                     format(str2,sizeof(str2),"KM/H: ~y~%d",kmh_anzahl);
  35.                     TextDrawSetString(kmh[i], str2);
  36.                 }
  37.                 else if(kmh_anzahl >= 50)
  38.                 {
  39.                     format(str2,sizeof(str2),"KM/H: ~g~%d",kmh_anzahl);
  40.                     TextDrawSetString(kmh[i], str2);
  41.                 }
  42.                 else
  43.                 {
  44.                     format(str2,sizeof(str2),"KM/H: ~b~%d",kmh_anzahl);
  45.                     TextDrawSetString(kmh[i], str2);
  46.                 }
  47.                 if(Speedo_HP >= 551)
  48.                 {
  49.                     format(str4,sizeof(str4),"Zustand: ~g~%.1f%", Speedo_HP/10); //%.2f
  50.                     TextDrawSetString(zustand[i], str4);
  51.                 }
  52.                 else if(Speedo_HP >= 361)
  53.                 {
  54.                     format(str4,sizeof(str4),"Zustand: ~y~%.1f%", Speedo_HP/10);
  55.                     TextDrawSetString(zustand[i], str4);
  56.                 }
  57.                 else
  58.                 {
  59.                     format(str4,sizeof(str4),"Zustand: ~r~%.1f%", Speedo_HP/10);
  60.                     TextDrawSetString(zustand[i], str4);
  61.                 }
  62.                 //new Float:mycarX,Float:mycarY,Float:mycarZ;
  63.                 //GetPlayerPos(i, mycarX,mycarY,mycarZ);
  64.                 //PlayerCar[i][Dtc_PlayerKey[i]][CarPos_x] = mycarX;
  65.                 //PlayerCar[i][Dtc_PlayerKey[i]][CarPos_y] = mycarY;
  66.                 //PlayerCar[i][Dtc_PlayerKey[i]][CarPos_z] = mycarZ;
  67.                 new owner = GetPlayerIdFromName(GetPlayerCarOwner(GetPlayerVehicleID(i))); //breadfish
  68.                 if(engine == 1)
  69.                 {
  70.                     if(IsAPlane(vehid) || IsABoat(vehid) || vehmodel == 462 || vehmodel == 481 || vehmodel == 431 || vehmodel == 437 || vehmodel == 511 || vehmodel == 577) // 462 = Faggio , 481 = BMX , 431 = Bus , 437 = Coach
  71.                     {
  72.                         return 1;
  73.                     }
  74.                     if(PlayerCar[owner][x][CarId] == vehid)
  75.                     {
  76.                         if(PlayerCar[owner][x][Fuel] < 99)
  77.                         {
  78.                             if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
  79.                             {
  80.                                 if(vehid != INVALID_VEHICLE_ID)
  81.                                 {
  82.                                     SetVehicleParamsEx(vehid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
  83.                                 }
  84.                                 PlayerCar[owner][x][Fuel] = 0;
  85.                                 format(string, sizeof(string), "~r~Tank leer");
  86.                                 GameTextForPlayer(i,string,5000,3);
  87.                             }
  88.                         }
  89.                     }
  90.                     else
  91.                     {
  92.                         SendClientMessage(i,F_Gray,"Woran scheiterts 1 ?");
  93.                         for(new fc = 0; fc<sizeof(FactionCars); fc++)
  94.                         {
  95.                             format(string, sizeof(string), "1 Vehid: %d | Carid: %d | Fuel: %d",FactionCars[fc][fVehid],FactionCars[fc][fCarid],FactionCars[fc][fFuel]);
  96.                             SendClientMessage(i,F_Gray,string);
  97.                             if(FactionCars[fc][fVehid] >= 400 && FactionCars[fc][fVehid] <= 611)
  98.                             {
  99.                                 format(string, sizeof(string), "2 Vehid: %d | Carid: %d | Fuel: %d",FactionCars[fc][fVehid],FactionCars[fc][fCarid],FactionCars[fc][fFuel]);
  100.                                 SendClientMessage(i,F_Gray,string);
  101.                                 if(vehid == FactionCars[fc][fCarid])
  102.                                 {
  103.                                     format(string, sizeof(string), "3 Vehid: %d | Carid: %d | Fuel: %d",FactionCars[fc][fVehid],FactionCars[fc][fCarid],FactionCars[fc][fFuel]);
  104.                                     SendClientMessage(i,F_Gray,string);
  105.                                     if(FactionCars[fc][fFuel] < 99)
  106.                                     {
  107.                                         format(string, sizeof(string), "4 Vehid: %d | Carid: %d | Fuel: %d",FactionCars[fc][fVehid],FactionCars[fc][fCarid],FactionCars[fc][fFuel]);
  108.                                         SendClientMessage(i,F_Gray,string);
  109.                                         if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
  110.                                         {
  111.                                             SendClientMessage(i,F_Gray,"Woran scheiterts 6 ?");
  112.                                             if(vehid != INVALID_VEHICLE_ID)
  113.                                             {
  114.                                                 SendClientMessage(i,F_Gray,"Woran scheiterts 7 ?");
  115.                                                 SetVehicleParamsEx(vehid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
  116.                                             }
  117.                                             SendClientMessage(i,F_Gray,"Woran scheiterts 8 ?");
  118.                                             FactionCars[fc][fFuel] = 0;
  119.                                             format(string, sizeof(string), "~r~Tank leer");
  120.                                             GameTextForPlayer(i,string,5000,3);
  121.                                             SendClientMessage(i,F_Gray,"Woran scheiterts 9 ?");
  122.                                         }
  123.                                     }
  124.                                 }
  125.                             }
  126.                         }
  127.                     }
  128.                     if(PlayerCar[owner][x][Fuel]/99 > 3)
  129.                     {
  130.                         format(str3,sizeof(str3),"Tank: ~g~%d / %d Liter", PlayerCar[owner][x][Fuel]/99, CarInfo[vehmodel-400][ci_CarMaxGas]);
  131.                     }
  132.                     else
  133.                     {
  134.                         PlayerPlaySound(i, 1085, 0.0, 0.0, 0.0);
  135.                         format(str3,sizeof(str3),"Tank: ~r~%d~g~ / %d Liter", PlayerCar[owner][x][Fuel]/99, CarInfo[vehmodel-400][ci_CarMaxGas]);
  136.                     }
  137.                     TextDrawSetString(hoehe[i], str3);
  138.                     SavePlayerPos[i][sX] = Speedo_X, SavePlayerPos[i][sY] = Speedo_Y, SavePlayerPos[i][sZ] = Speedo_Z;
  139.                 }
  140.             }
  141.         }
  142.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement