én ezt találtam egy elég rövid speedometert de nem igazán vágom
[pawn]#include <a_samp>
new Text: esp[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
esp[playerid] = TextDrawCreate(554.0,101.0,\" \");
TextDrawUseBox(esp[playerid],1);
TextDrawBoxColor(esp[playerid],0x00000099);
TextDrawTextSize(esp[playerid],652.0,124.0);
TextDrawAlignment(esp[playerid],0);
TextDrawBackgroundColor(esp[playerid],0x00000033);
TextDrawFont(esp[playerid],2);
TextDrawLetterSize(esp[playerid],0.399999,1.3);
TextDrawColor(esp[playerid],0xffffff99);
TextDrawSetProportional(esp[playerid],1);
TextDrawSetShadow(esp[playerid],2);
return 1;
}
public OnPlayerUpdate(playerid)
{
if(!IsPlayerInAnyVehicle(playerid)) return 1;
new estr[16],speed = GetSpeed(playerid);
if(!speed || speed < 0) return TextDrawSetString(esp[playerid],\" - km/h\");
format(estr,16,\"%d km/h\",speed);
TextDrawSetString(esp[playerid],estr);
return 1;
}
GetSpeed(id)
{
new Float:s[4];
GetVehicleVelocity(GetPlayerVehicleID(id),s[0],s[1],s[2]);
return floatround(1.61*floatsqroot(floatabs(floatpower(s[0]+s[1]+s[2],2)))*100);
}
public OnPlayerDisconnect(playerid, reason) return TextDrawHideForPlayer(playerid,esp[playerid]),TextDrawDestroy(esp[playerid]),1;
public OnPlayerStateChange(playerid, newstate, oldstate) if(oldstate-1 && newstate) TextDrawHideForPlayer(playerid,esp[playerid]); else if(newstate-1) TextDrawShowForPlayer(playerid,esp[playerid]);
[/pawn]