09.02.2012, 02:50
Alright. Just a sec, I will show you my code.
On top of the GM/FS
OnPlayerConnect put this
OnPlayerUpdate add this
On top of the GM/FS
PHP Code:
new Text:SPEEDOS[MAX_PLAYERS]; //speedometer
PHP Code:
SPEEDOS[playerid] = TextDrawCreate(10.0,200.0," ");
TextDrawShowForPlayer(playerid,SPEEDOS[playerid]);
PHP Code:
new vehicleid,Float:speed_x,Float:speed_y,Float:speed_z,Float:final_speed,speed_string[256],final_speed_int;
vehicleid = GetPlayerVehicleID(playerid);
if(vehicleid != 0)
{
GetVehicleVelocity(vehicleid,speed_x,speed_y,speed_z);
final_speed = floatsqroot(((speed_x*speed_x)+(speed_y*speed_y))+(speed_z*speed_z))*136.666667;
final_speed_int = floatround(final_speed,floatround_round);
format(speed_string,256,"Speed: %i",final_speed_int);
TextDrawSetString(SPEEDOS[playerid], speed_string);
}
else
{
TextDrawSetString(SPEEDOS[playerid], " ");
}