HUD/Textdraw
#1

Well, most server have custom HUDS.
I've just downloaded a gamemode and now I want to change the color of the HUD which is currently green, to another color. I believe these are the lines that put the HUD in place. Unfortunately, I can't see and color codes in the area.
Sorry for being too questionable, I'm just new.
Any help would be appreciated.

Current color (I want to change the green part):


Код:
{
	    		//format(string, sizeof(string), "~r~Health:~w~ %.0f%%  ~n~~r~Time:~w~ %02d:%02d~n~~r~Weapon: ~w~%s~n~~r~Money: ~w~пїЅ%s",pH, t[0], t[1], aWeaponNames[GetPlayerWeapon(i)], number_format(PlayerTemp[i][sm]));
				format(string, sizeof(string), "~g~Weapon: ~w~%s~n~~g~Money: ~w~$%s", aWeaponNames[GetPlayerWeapon(i)], number_format(PlayerTemp[i][sm]));
	    		TextDrawSetString(PlayerTemp[i][Status], string);
	    		if(tazed[ i ]) ApplyAnimation(i,"CRACK", "crckdeth2", 4.1, 0, 0, 0, 1, 1); // irl crack!
       		}
        	else
			{
            	GetPlayerPos(i, x, y, z);
           		distance = floatsqroot(floatpower(floatabs(floatsub(x,SavePlayerPos[i][LastX])),2)+floatpower(floatabs(floatsub(y,SavePlayerPos[i][LastY])),2)+floatpower(floatabs(floatsub(z,SavePlayerPos[i][LastZ])),2));
            	value = floatround(distance * 5600);
            	new Float:tmph;
            	GetVehicleHealth(GetPlayerVehicleID(i), tmph);

				//format(string, sizeof(string), "~r~Health:~w~ %.0f%%  ~n~~r~Time:~w~ %02d:%02d~n~~r~Weapon:~w~%s~n~~r~Money: ~w~пїЅ%s~n~~r~Vehicle: ~w~%s~n~~r~Fuel:~w~ %d%%~n~~r~Speed: ~w~%d",pH, t[0], t[1], aWeaponNames[GetPlayerWeapon(i)], number_format(PlayerTemp[i][sm]), GetVehicleName(GetPlayerVehicleID(i)), Gas[GetPlayerVehicleID(i)], floatround(value/600));
				format(string, sizeof(string), "~g~Weapon: ~w~%s~n~~g~Money: ~w~$%s~n~~g~Vehicle: ~w~%s~n~~g~Fuel: ~w~%d%%~n~~g~Speed: ~w~%d KM/H",aWeaponNames[GetPlayerWeapon(i)], number_format(PlayerTemp[i][sm]), GetVehicleName(GetPlayerVehicleID(i)), Gas[GetPlayerVehicleID(i)], floatround(value/600));
	    		TextDrawSetString(PlayerTemp[i][Status], string);
				if(Gas[GetPlayerVehicleID(i)] <= 10 && IsPlayerDriver(i)) TDWarning(i, "you are running out of fuel!", 1400);
         		if(Gas[GetPlayerVehicleID(i)] <= 0 && IsPlayerDriver(i)) RemovePlayerFromVehicle(i), SendClientInfo(i, "No fuel!");
         		SavePlayerPos[i][LastX] = x;
          		SavePlayerPos[i][LastY] = y;
         		SavePlayerPos[i][LastZ] = z;
	    	}
		}
	}
	return 1;
}
Reply
#2

Edit : added SS.
Reply
#3

Come on anyone?
Reply
#4

BUMP - I need this real bad
Reply
#5

Change ~g~ to whatever color you want..(one from down below)
Код:
~r~    red
~g~    green
~b~    blue
~w~    white
~y~    yellow
~p~    purple
~l~    black
~h~    lighter color
Reply
#6

Thank you very much.
And isn't it possible to use some other colors? or are the ones that you mentioned the only ones?
Reply
#7

?
Reply
#8

If you use TextDrawColor, you can give your text any color you want. But this will only work until it finds another color code in the text to overwrite the current color. By simply removing ~g~ completely from the text, it should give the beginning of the text the color set in TextDrawColor.
Reply
#9

Thank you very much!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)