Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.68 KB | None | 0 0
  1. new Float:Trip[MAX_VEHICLES];
  2.  
  3. public OnFilterScriptInit()
  4. {
  5.     print("\n--------------------------------------");
  6.     print("Jakku - Speedometer/Fuel system");
  7.     print("--------------------------------------\n");
  8.  
  9.     for(new Vehicles = 0; Vehicles < MAX_VEHICLES; Vehicles++)
  10.     {
  11.         Trip[Vehicles] = 0.00;
  12.     }
  13.  
  14. }
  15.  
  16.  
  17. public Speedometer()
  18. {
  19.     for(new i = 0; i < MAX_PLAYERS; i++)
  20.     {
  21.         if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
  22.         {
  23.             if(ShowSpeed[i] == 1)
  24.             {
  25.                 new Float:x, Float:y, Float:z, Float:Dis, Float:health, string[256];TextDrawDestroy(black[i]); TextDrawDestroy(Speedom[i]);
  26.                 new vehicleid = GetPlayerVehicleID(i);
  27.                 Dis = floatsqroot(floatpower(floatabs(floatsub(OldCoordsX[i],x)),2) + floatpower(floatabs(floatsub(OldCoordsY[i],y)),2));
  28.  
  29.                 if( speed == 0 ){
  30.                 format(string,sizeof(string),"~B~Trip:~w~%d Km",Trip[vehicleid]);
  31.                 } else if( speed >= 1 && speed <= 99 ){
  32.                     format(string,sizeof(string),"~B~Trip:~w~%d Km",Trip[vehicleid]);
  33.                     Trip[vehicleid] += 0.03;
  34.                 } else if( speed >= 100 && speed <= 179 ){
  35.                     format(string,sizeof(string),"~B~Trip:~w~%d Km",Trip[vehicleid]);
  36.                     Trip[vehicleid] += 0.06;
  37.                 } else {
  38.                     format(string,sizeof(string),"~B~Trip:~w~%d Km",Trip[vehicleid]);
  39.                     Trip[vehicleid] += 0.10;
  40.                 }
  41.  
  42.                 black[i] = TextDrawCreate(504.000000,379.000000,"_");
  43.                 TextDrawUseBox(black[i],0);
  44.                 TextDrawBoxColor(black[i],0x00000085);
  45.                 TextDrawTextSize(black[i],621.000000,0.000000);
  46.                 TextDrawAlignment(black[i],0);
  47.                 TextDrawBackgroundColor(black[i],0x000000FF);
  48.                 TextDrawFont(black[i],3);
  49.                 TextDrawLetterSize(black[i],1.700000,5.250000);
  50.                 TextDrawColor(black[i],0xFFFFFFFF);
  51.                 TextDrawSetOutline(black[i],1);
  52.                 TextDrawSetProportional(black[i],1);
  53.                 TextDrawSetShadow(black[i],1);
  54.  
  55.                 Speedom[i] = TextDrawCreate(505.000000,380.000000,string);
  56.                 TextDrawUseBox(Speedom[i],0);
  57.                 TextDrawBoxColor(Speedom[i],0xFFFFFF85);
  58.                 TextDrawTextSize(Speedom[i],620.000000,0.000000);
  59.                 TextDrawAlignment(Speedom[i],0);
  60.                 TextDrawBackgroundColor(Speedom[i],0x000000FF);
  61.                 TextDrawFont(Speedom[i],1);
  62.                 TextDrawLetterSize(Speedom[i],0.299999,1.000000);
  63.                 TextDrawColor(Speedom[i],0xFFFFFFFF);
  64.                 TextDrawSetOutline(Speedom[i],1);
  65.                 TextDrawSetProportional(Speedom[i],1);
  66.                 TextDrawSetShadow(Speedom[i],1);
  67.  
  68.                 TextDrawShowForPlayer(i, black[i]);
  69.                 TextDrawShowForPlayer(i, Speedom[i]);
  70.                 OldCoordsX[i] = x; OldCoordsY[i] = y;
  71.             } else {
  72.                 TextDrawDestroy(black[i]);
  73.                 TextDrawDestroy(Speedom[i]);
  74.             }
  75.         }
  76.     }
  77.     return true;
  78. }
  79.  
  80. //Sad sam slucajno izbriso getspeed i sl., al to definisi, a velicinu txtdrawowa nisam ni pokusavo uredjivat...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement