Use HTML Code in Menu
#1

Title^

is it possible to do this:

pawn Code:
TuningMenu = CreateMenu("TuningMenu",1,445,110,155,40);
    AddMenuItem(TuningMenu,0,"{FF0000}Paint Jobs");
    AddMenuItem(TuningMenu,0,"{FF0000}Colors");
    AddMenuItem(TuningMenu,0,"{FF0000}Exhausts");
    AddMenuItem(TuningMenu,0,"{FF0000}Front Bumper");
    AddMenuItem(TuningMenu,0,"{FF0000}Rear Bumper");
    AddMenuItem(TuningMenu,0,"{FF0000}Roof");
    AddMenuItem(TuningMenu,0,"{FF0000}Spoilers");
    AddMenuItem(TuningMenu,0,"{FF0000}Side Skirts");
    AddMenuItem(TuningMenu,0,"{FF0000}Wheels");
    AddMenuItem(TuningMenu,0,"{FF0000}Hydraulics");
    AddMenuItem(TuningMenu,0,"{FF0000}Nitro");
Reply
#2

I don't think so, because this is PAWN Language and the AMX Compiler can read only PAWN Languages and not HTML.

Now the main question is, why do you want use HTML code? Do you want center the text?
Reply
#3

If you mean RGB colors, no. You can use these, though:

Code:
~r~    red
~g~    green
~b~    blue
~w~    white
~y~    yellow
~p~    purple
~l~    black
~h~    lighter color
Reply
#4

Well I have a speedo meter and I will allow players to buy another color, but I want them to know what color they are buying xD

and in SendClientMessage {FF0000} Works..
Reply
#5

SendClientMessage is a samp function, it was designed to accept HEX colours, while menus are internal SA feature that cannot be edited to do such a thing
Reply
#6

I think using colours on Menu's isn't allowed, but i'm not sure.

https://sampwiki.blast.hk/wiki/AddMenuItem
Reply
#7

Well, this guy did it: http://imageshack.us/photo/my-images...052f.png/?sa=0

I'm 100% positive there can't be used HEX colors, so he must've done it with these TextDraw codes.



Quote:
Originally Posted by Stefand
View Post
Well I have a speedo meter and I will allow players to buy another color, but I want them to know what color they are buying xD

and in SendClientMessage {FF0000} Works..
Dialogs are much better in my opinion, and they also accept HEX colors.
Btw, you can do something like "Preview color" and when a player selects it, the speedometer in the selected color will pop up for him to see.
Reply
#8

Quote:
Originally Posted by Pooh7
View Post
Well, this guy did it: http://imageshack.us/photo/my-images...052f.png/?sa=0

I'm 100% positive there can't be used HEX colors, so he must've done it with these TextDraw codes.





Dialogs are much better in my opinion, and they also accept HEX colors.
Btw, you can do something like "Preview color" and when a player selects it, the speedometer in the selected color will pop up for him to see.
I will find some solution I think xD
Reply
#9

You can't use HEX codes in menus, only gametext colors: https://sampwiki.blast.hk/wiki/GameTextStyle

pawn Code:
TuningMenu = CreateMenu("TuningMenu",1,445,110,155,40);
AddMenuItem(TuningMenu,0,"~r~Paint Jobs");
AddMenuItem(TuningMenu,0,"~r~Colors");
AddMenuItem(TuningMenu,0,"~r~Exhausts");
AddMenuItem(TuningMenu,0,"~r~Front Bumper");
AddMenuItem(TuningMenu,0,"~r~Rear Bumper");
AddMenuItem(TuningMenu,0,"~r~Roof");
AddMenuItem(TuningMenu,0,"~r~Spoilers");
AddMenuItem(TuningMenu,0,"~r~Side Skirts");
AddMenuItem(TuningMenu,0,"~r~Wheels");
AddMenuItem(TuningMenu,0,"~r~Hydraulics");
AddMenuItem(TuningMenu,0,"~r~Nitro");
Reply
#10

Quote:
Originally Posted by IstuntmanI
View Post
You can't use HEX codes in menus, only gametext colors: https://sampwiki.blast.hk/wiki/GameTextStyle

pawn Code:
TuningMenu = CreateMenu("TuningMenu",1,445,110,155,40);
AddMenuItem(TuningMenu,0,"~r~Paint Jobs");
AddMenuItem(TuningMenu,0,"~r~Colors");
AddMenuItem(TuningMenu,0,"~r~Exhausts");
AddMenuItem(TuningMenu,0,"~r~Front Bumper");
AddMenuItem(TuningMenu,0,"~r~Rear Bumper");
AddMenuItem(TuningMenu,0,"~r~Roof");
AddMenuItem(TuningMenu,0,"~r~Spoilers");
AddMenuItem(TuningMenu,0,"~r~Side Skirts");
AddMenuItem(TuningMenu,0,"~r~Wheels");
AddMenuItem(TuningMenu,0,"~r~Hydraulics");
AddMenuItem(TuningMenu,0,"~r~Nitro");
Red was just an example, I need grey, yellow, green, red, blue, light blue, light red, and white lol
Reply
#11

Quote:
Originally Posted by Stefand
View Post
Red was just an example, I need grey, yellow, green, red, blue, light blue, light red, and white lol
You can't obtain grey, you could try another color.
Yellow - ~y~
Green - ~g~
Red - ~r~
Light blue - ~b~~h~, or even with more ~h~ if you need: ~b~~h~~h~ etc.
Light red - ~r~~h~, or even with more ~h~ if you need: ~r~~h~~h~ etc.
White - ~w~

If you don't want these colors, you could just use dialogs, they are easier to use, looks better and supports hex.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)