Moving a speedo box & Text
#1

hi guys am trying to move the speedo box on the right an side i can get the box on the rigth an side but the text saying fuel and speed i cant move it

here is a photo anyways http://i.imgur.com/Tkq8Nbq.jpg

well here is the code if you have any ideas what can i do?


Код:
public Speedometer()
{
 	new vehicleid, Float:health;
	new engine, lights, alarm, doors, bonnet, boot, objective;
	new fstring[32], string[512];

	for(new i=0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
		{
			vehicleid = GetPlayerVehicleID(i);
			GetVehicleHealth(vehicleid, health);
			GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);

			strcat(string, "~n~~b~~h~health: ~g~", sizeof(string));
			fstring = "iiiiiiiiii";
			if(health > 1000.0) strins(fstring, "~r~", 10, sizeof(fstring));
			else if(health < 0.0) strins(fstring, "~r~", 0, sizeof(fstring));
			else strins(fstring, "~r~", floatround(health/100.0), sizeof(fstring));
			strcat(string, fstring, sizeof(string));

			strcat(string, "        ~b~~h~fuel: ~g~", sizeof(string));
			fstring = "iiiiiiiiii";
			if(Fuel[vehicleid] > 100.0) strins(fstring, "~r~", 10, sizeof(fstring));
			else if(Fuel[vehicleid] < 0.0) strins(fstring, "~r~", 0, sizeof(fstring));
			else strins(fstring, "~r~", floatround(Fuel[vehicleid]/10.0), sizeof(fstring));
			strcat(string, fstring, sizeof(string));
			TextDrawSetString(SpeedoText[i], string);
		}
	}
}


Код:
        SpeedoText[playerid] = TextDrawCreate(180.000, 362.000," ");
	TextDrawAlignment(SpeedoText[playerid], 1);
	TextDrawFont(SpeedoText[playerid],2);
	TextDrawLetterSize(SpeedoText[playerid], 0.310, 1.400);
	TextDrawSetShadow(SpeedoText[playerid],0);
	TextDrawUseBox(SpeedoText[playerid], 1);
	TextDrawBoxColor(SpeedoText[playerid], 0x99);
	TextDrawTextSize(SpeedoText[playerid], 520.000, 0.000);
Reply
#2

maybe there are in 1 textdraw just with formatted string ?
Reply
#3

Play with the numbers I've made bold.

SpeedoText[playerid] = TextDrawCreate(180.000, 362.000," ");

Those are X and Y coordinates. The first is X which deals with left and right and Y which deals with up and down.

+ rep if helped!
Reply
#4

i try and mess around with it so the speedotext is the one with the letters ?
Reply
#5

Oh you want the "MPH" to move to the right?

I can't find MPH on the code above, make sure you send me all of the code containing the speed.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)