pawn Код:
#include <a_samp>
#include <zcmd>
#define DIALOGO_COLORES 1500
enum _@en@colores
{
colorNombre[24],
colorHex,
ColorInsert[7]
}
new const colores[][_@en@colores] =
{
{"Rojo", 0xFF0000FF, "FF0000"},
{"Celeste", 0x00CAFFFF, "00CAFF"},
{"Azul", 0x0000FFFF, "0000FF"},
{"Rosa", 0xFF00FFFF, "FF00FF"},
{"Verde", 0x00D600FF, "00D600"},
{"Lima", 0x00FF00FF, "00FF00"},
{"Naranja", 0xFF6400FF, "FF6400"},
{"Amarillo", 0xFFFF00FF, "FFFF00"},
{"Violeta", 0x9400FFFF, "9400FF"},
{"Negro", 0x000000FF, "000000"},
{"Blanco", 0xFFFFFFFF, "FFFFFF"},
{"Marron", 0x833500FF, "833500"},
{"Aqua", 0x00FFFFFF, "00FFFF"}
};
COMMAND:colores(playerid, params[])
{
new tmp[32 * sizeof(colores)], tmp2[32];
for(new i=0; i<sizeof(colores); i++)
{
format(tmp2, sizeof(tmp2), "{%s}%s\n", colores[i][ColorInsert], colores[i][colorNombre]);
strcat(tmp, tmp2);
}
ShowPlayerDialog(playerid, DIALOGO_COLORES, DIALOG_STYLE_LIST, "Colores", tmp, "Aceptar", "");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case DIALOGO_COLORES:
{
new tmp[64];
format(tmp, sizeof(tmp), "Tu nick ahora es de color %s", colores[listitem][colorNombre]);
SendClientMessage(playerid, colores[listitem][colorHex], tmp);
SetPlayerColor(playerid, colores[listitem][colorHex]);
}
}
return 0;
}