Advertisement
Guest User

Zezombia

a guest
Jun 8th, 2008
506
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.88 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #define FILTERSCRIPT
  4. #if defined FILTERSCRIPT
  5.  
  6. forward Speedo();
  7. new Float:newX[MAX_PLAYERS], Float:newY[MAX_PLAYERS], Float:newZ[MAX_PLAYERS];
  8. new Float:oldX[MAX_PLAYERS], Float:oldY[MAX_PLAYERS], Float:oldZ[MAX_PLAYERS];
  9. new Float:Num[MAX_PLAYERS];
  10. new String[256];
  11.  
  12. public OnFilterScriptInit()
  13. {
  14.     SetTimer("Speedo", 1000, 1);
  15.     return 1;
  16. }
  17.  
  18. #endif
  19.  
  20. public Speedo()
  21. {
  22.     for(new i = 0; i < MAX_PLAYERS; i++)
  23.     {
  24.         if(IsPlayerInAnyVehicle(i) == 1)
  25.         {
  26.             GetPlayerPos(i, newX[i], newY[i], newZ[i]);
  27.             Num[i] = (newX[i] - oldX[i]) - (newY[i] - oldY[i]) - (newZ[i] - oldZ[i]);
  28.             oldX[i] = newX[i]; oldY[i] = newY[i]; oldZ[i] = newZ[i];
  29.             Num[i] = Num[i] * 4;
  30.  
  31.             if(Num[i] < 0)
  32.             {
  33.                 Num[i] = Num[i] - Num[i] - Num[i];
  34.             }
  35.  
  36.             format(String, sizeof(String), "MPH: %0.0f", Num[i]);
  37.             GameTextForPlayer(i, String, 1000, 5);
  38.         }
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement