#include #define SLOTS 100 enum SavePlayerPosEnum { Float:LastX, Float:LastY, Float:LastZ } new SavePlayerPos[SLOTS][SavePlayerPosEnum]; new SpeedMode = 0; // 0 for KPH, 1 for MPH new UpdateSeconds = 1; //1=jedna sekunda odświeżanie new speedtimer; public OnFilterScriptInit() { print("\n----------------------------------"); print("Filterscript NAZWA sucessfully loaded"); print("----------------------------------\n"); } public OnFilterScriptExit() { print("\n----------------------------------"); print("Filterscript NAZWA sucessfully un-loaded"); print("----------------------------------\n"); } public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(cmdtext, "/speed-off", true)==0) { KillTimer(speedtimer); return 1; } if (strcmp(cmdtext, "/speed-on", true)==0) { speedtimer = SetTimer("UpdateSpeed", UpdateSeconds*1000, 1); return 1; } return 0; } public OnGameModeInit() { speedtimer = SetTimer("UpdateSpeed", UpdateSeconds*1000, 1); } public GameModeExitFunc() { KillTimer(speedtimer); } public UpdateSpeed(){ new Float:x,Float:y,Float:z; new Float:distance,value,string[256]; for(new i=0; i 1){ value = floatround(value / UpdateSeconds); } if(SpeedMode){ format(string,sizeof(string),"~w~%d MPH",floatround(value/1600)); GameTextForPlayer(i, string, 1100, 5); } else{ format(string,sizeof(string),"~n~~n~~n~~n~~n~~n~~n~~w~%d ~r~KM/H",floatround(value/1000)); GameTextForPlayer(i, string, 1100, 5); } SavePlayerPos[i][LastX] = x; SavePlayerPos[i][LastY] = y; SavePlayerPos[i][LastZ] = z; } } }