Textdraw3 = TextDrawCreate(548 ,416 , "Speed");
TextDrawFont(Textdraw3 , 3);
TextDrawLetterSize(Textdraw3 , 0.4, 2.8000000000000003);
TextDrawColor(Textdraw3 , 0xffffffFF);
TextDrawSetOutline(Textdraw3 , false);
TextDrawSetProportional(Textdraw3 , true);
TextDrawSetShadow(Textdraw3 , 1);
public SpeedMeter()
{
for(new x; x<MAX_PLAYERS; x++)
{
new TDstring[256];
format(TDstring, sizeof(TDstring), "~w~Speed: %i");
TextDrawSetString(Textdraw3[x], TDstring);
}
return 1;
}
new Float:vx, Float:vy, Float:vz, Float:vel;
vel = GetVehicleVelocity(GetPlayerVehicleID(playerid), vx, vy, vz);
vel = (floatsqroot(((vx*vx)+(vy*vy))+(vz*vz))* 181.5);
public SpeedMeter()
{
for(new x; x<MAX_PLAYERS; x++)
{
if(IsPlayerConnected(x) && IsPlayerInAnyVehicle(x))
{
new Float:x,Float:y,Float:z,TDstring[256],vehicleid = GetPlayerVehicleID(x);
TextDrawShowForPlayer(x,Textdraw3[x]);
GetVehicleVelocity(vehicleid,x,y,z);
format(TDstring, sizeof(TDstring), "~w~Speed: %d",floatround(floatsqroot(((x*x)+(y*y))+(z*z))*250.666667));
TextDrawSetString(Textdraw3[x], TDstring);
}
}
return 1;
}
|
LoLeC's solution will work but use 181.5 instead of 250.666667 he doesn't know what he's talking about.
|