HUD/Textdraw - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: HUD/Textdraw (
/showthread.php?tid=453140)
HUD/Textdraw -
Nahin - 23.07.2013
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;
}
Re: HUD/Textdraw -
Nahin - 23.07.2013
Edit : added SS.
Re: HUD/Textdraw -
Nahin - 24.07.2013
Come on anyone?
Re: HUD/Textdraw -
Nahin - 24.07.2013
BUMP - I need this real bad
Re: HUD/Textdraw -
InfiniTy. - 24.07.2013
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
Re: HUD/Textdraw -
Nahin - 24.07.2013
Thank you very much.
And isn't it possible to use some other colors? or are the ones that you mentioned the only ones?
Re: HUD/Textdraw -
Nahin - 24.07.2013

?
Re: HUD/Textdraw -
Basssiiie - 24.07.2013
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.
Re: HUD/Textdraw -
Nahin - 25.07.2013
Thank you very much!