Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define FILTERSCRIPT
- #if defined FILTERSCRIPT
- forward Speedo();
- new Float:newX[MAX_PLAYERS], Float:newY[MAX_PLAYERS], Float:newZ[MAX_PLAYERS];
- new Float:oldX[MAX_PLAYERS], Float:oldY[MAX_PLAYERS], Float:oldZ[MAX_PLAYERS];
- new Float:Num[MAX_PLAYERS];
- new String[256];
- public OnFilterScriptInit()
- {
- SetTimer("Speedo", 1000, 1);
- return 1;
- }
- #endif
- public Speedo()
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerInAnyVehicle(i) == 1)
- {
- GetPlayerPos(i, newX[i], newY[i], newZ[i]);
- Num[i] = (newX[i] - oldX[i]) - (newY[i] - oldY[i]) - (newZ[i] - oldZ[i]);
- oldX[i] = newX[i]; oldY[i] = newY[i]; oldZ[i] = newZ[i];
- Num[i] = Num[i] * 4;
- if(Num[i] < 0)
- {
- Num[i] = Num[i] - Num[i] - Num[i];
- }
- format(String, sizeof(String), "MPH: %0.0f", Num[i]);
- GameTextForPlayer(i, String, 1000, 5);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement