13.01.2014, 15:42
I am having a weird issue with my speedo meter, copying over eachother. It is not giving any sence to me.
pawn Код:
Speed[playerid] = TextDrawCreate(489.000122, 357.155487, "");
TextDrawLetterSize(Speed[playerid], 0.449999, 1.600000);
TextDrawAlignment(Speed[playerid], 1);
TextDrawColor(Speed[playerid], -1);
TextDrawSetShadow(Speed[playerid], 0);
TextDrawSetOutline(Speed[playerid], 1);
TextDrawBackgroundColor(Speed[playerid], 51);
TextDrawFont(Speed[playerid], 1);
TextDrawSetProportional(Speed[playerid], 1);
TextDrawShowForPlayer(playerid, Speed[playerid]);
forward Speedo(playerid);
public Speedo(playerid)
{
new vehicleid,Float:speed_x,Float:speed_y,Float:speed_z,Float:final_speed,speed_string[24],final_speed_int;
vehicleid = GetPlayerVehicleID(playerid);
GetVehicleVelocity(vehicleid, speed_x, speed_y, speed_z);
final_speed = floatsqroot(((speed_x*speed_x)+(speed_y*speed_y))+(speed_z*speed_z))*95.0;
final_speed_int = floatround(final_speed, floatround_round);
format(speed_string, sizeof(speed_string), "~b~S~w~peed:~b~ %i", final_speed_int);
TextDrawSetString(Speed[playerid], speed_string);
return 1;
}
SpeedoTimer[playerid] = SetTimerEx("Speedo", 100, 1, "i", playerid);