04.04.2019, 03:00
PHP Code:
#include "a_samp"
enum colorData {
colorName[24],
color
};
new
Colors[][colorData] = {
{"White", 0xFFFFFFFF},
{"Middle Purple", 0xD782BAFF},
{"Plum", 0xE18AD4FF},
{"Pink Pearl", 0xEEB1D5FF},
{"Classic Rose", 0xEFC7E5FF},
{"Platinum", 0xE0EFDAFF}
};
new
PlayerColor[MAX_PLAYERS];
main() {}
public OnPlayerText(playerid, text[]) {
new
message[144],
name[MAX_PLAYER_NAME];
format(message, sizeof(message), "{%06x}%s{ffffff}[%i]: %s", (Colors[PlayerColor[playerid]][color] >>> 8), (GetPlayerName(playerid, name, MAX_PLAYER_NAME), name), playerid, text);
SendClientMessageToAll(-1, message);
return 0;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/minhacor", true))
{
new
string[sizeof(Colors) * 35];
for (new i; i != sizeof(Colors); i ++)
format(string, sizeof(string), "%s\n{%06x}%s %s", string, (Colors[i][color] >>> 8), Colors[i][colorName], ((!i) ? ("(Padrгo)") : (" ")));
ShowPlayerDialog(playerid, 2478, DIALOG_STYLE_LIST, "Escolha uma cor", string, "Escolher", "Fechar");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
if (!response)
return 1;
if (dialogid == 2478) {
PlayerColor[playerid] = listitem;
}
return 1;
}