#include public OnFilterScriptInit() { print("\n----------------------------------"); print("Filterscript Speedometer loaded"); print("----------------------------------\n"); } public OnFilterScriptExit() { print("\n----------------------------------"); print("Filterscript Speedometer un-loaded"); print("----------------------------------\n"); } forward UpdateSpeed(); enum SavePlayerPosEnum { Float:LastX, Float:LastY, Float:LastZ } #define SLOTS 100 new SavePlayerPos[SLOTS][SavePlayerPosEnum]; new SpeedMode = 1; // 0 for KPH, 1 for MPH new UpdateSeconds = 1; // How frequent do you want it to be updated? public UpdateSpeed(){ new Float:x,Float:y,Float:z; new Float:distance,value; for(new i=0; i 1){ value = floatround(value / UpdateSeconds); } // meters an hour if(SpeedMode == 1){ new stringkmh[256]; format(stringkmh,sizeof(stringkmh),"~r~%d KMH~n~%d MPH",floatround(value/1000),floatround(value/1600)); GameTextForPlayer(i, stringkmh, 1000, 4); } SavePlayerPos[i][LastX] = x; SavePlayerPos[i][LastY] = y; SavePlayerPos[i][LastZ] = z; } // End is-player-connected } // End for-loop } // eind UpdateSpeed function new MaxTimer[MAX_PLAYER_NAME]; /* MaxTimer = SetTimer("UpdateSpeed", UpdateSeconds*1000, 1); */ public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { /* new MaxTimer; */ MaxTimer[playerid] = SetTimer("UpdateSpeed", UpdateSeconds*1000, 1); return 1; } public OnPlayerExitVehicle(playerid, vehicleid) { KillTimer(MaxTimer[playerid]); return 1; }