format(text, sizeof(text), "Setting\tInformation\nStatus\tCivilian\nPM\t%d\nMusic\t%d\nCar HUD\t%d\nHit Effect Sound\tOFF", Player[playerid][playerPmStatus], Player[playerid][playerMusic], vstatus[2]);
strreplace(text, "1", "{33AA33}ON");
strreplace(text, "0", "{AA3333}OFF");
format(text2, sizeof(text2), "\nPM Color Code\t{%s}%s\nNotification Color Code\t{%s}%s", Player[playerid][playerPMColor], Player[playerid][playerPMColor], Player[playerid][playerNotificationColor], Player[playerid][playerNotificationColor]);
strcat(text, text2);
ShowPlayerDialog(playerid, DIALOG_SETTINGS, DIALOG_STYLE_TABLIST_HEADERS, "Settings", text, "Select", "Cancel");
CMD:test(playerid) { new text[300] = "Setting\tInformation\nStatus\tCivilian\nPM\t{33AA33}ON\nMusic\t{33AA33}ON\nCar HUD\t{33AA33}ON\nHit Effect Sound\t{33AA33}ON"; new text2[128] = "\nPM Color Code\t{00FF00}00FF00\nNotification Color Code\t{FF0000}FF0000"; strcat(text, text2); ShowPlayerDialog(playerid, DIALOG_DUMMY, DIALOG_STYLE_TABLIST_HEADERS, "Settings", text, "Select", "Cancel"); return 1; }
I've used this code:
Код:
CMD:test(playerid) { new text[300] = "Setting\tInformation\nStatus\tCivilian\nPM\t{33AA33}ON\nMusic\t{33AA33}ON\nCar HUD\t{33AA33}ON\nHit Effect Sound\t{33AA33}ON"; new text2[128] = "\nPM Color Code\t{00FF00}00FF00\nNotification Color Code\t{FF0000}FF0000"; strcat(text, text2); ShowPlayerDialog(playerid, DIALOG_DUMMY, DIALOG_STYLE_TABLIST_HEADERS, "Settings", text, "Select", "Cancel"); return 1; } ![]() So it looks that everything is working fine. I can see that you are outputting {AFFFFFF} which isn't a valid embedded RGB color in SAMP (7 digits), that may be your problem. I'd rather store the users PM color as an integer value by converting the hex string to int and simply using {%06x} in format() |
If hardcoding works, then it's not any SAMP limitation or bug, that's why I tried it with hardcoded colors.
Your formatting code is just bad. If you allow the player to type in their custom hex color: https://sampwiki.blast.hk/wiki/Colors_List Grab the HexToInt function Store the color field in database as integer, and in Pawn too When the player inputs his color, do color = HexToInt(inputtext) When formatting the dialog, use "{%06x}", color It has to work. |
Player[playerid][playerPMColor] >>> 8