Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <zcmd>
- #include <foreach>
- #define DIALOG_ACOLOR (19000)
- enum playervEnum { pAColor }
- new playerVariables[MAX_PLAYERS][playervEnum];
- stock nearByMessage(playerid, color, string[], Float: Distance3 = 12.0) {
- new
- Float: nbCoords[3];
- GetPlayerPos(playerid, nbCoords[0], nbCoords[1], nbCoords[2]);
- foreach(Player, i) {
- if(IsPlayerInRangeOfPoint(i, Distance3, nbCoords[0], nbCoords[1], nbCoords[2]) && (GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))) {
- SendClientMessage(i, color, string);
- }
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch(dialogid)
- {
- case DIALOG_ACOLOR:
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:
- {
- {
- playerVariables[playerid][pAColor] = 1;
- SendClientMessage(playerid, -1, "{ef0031}Server: {FFFFFF}Nick color changed. Hope you like the new color!");
- }
- }
- case 1:
- {
- {
- playerVariables[playerid][pAColor] = 2;
- SendClientMessage(playerid, -1, "{ad0000}Server: {FFFFFF}Nick color changed. Hope you like the new color!");
- }
- }
- case 2:
- {
- {
- playerVariables[playerid][pAColor] = 3;
- SendClientMessage(playerid, -1, "{9d299d}Server: {FFFFFF}Nick color changed. Hope you like the new color!");
- }
- }
- }
- }
- }
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- if(playerVariables[playerid][pAColor] == 1) format(szMessage, sizeof(szMessage), "{ef0031}%s:{FFFFFF} %s", szPlayerName, text);
- if(playerVariables[playerid][pAColor] == 2) format(szMessage, sizeof(szMessage), "{ad0000}%s:{FFFFFF} %s", szPlayerName, text);
- if(playerVariables[playerid][pAColor] == 3) format(szMessage, sizeof(szMessage), "{DB464E}%s:{FFFFFF} %s", szPlayerName, text);
- nearByMessage(playerid, COLOR_GREY, szMessage);
- format(szMessage, sizeof(szMessage), "\"%s\"", text);
- SetPlayerChatBubble(playerid, szMessage, COLOR_CHATBUBBLE, 10.0, 10000);
- return 1;
- }
- CMD:acolor(playerid, params[])
- {
- if(playerVariables[playerid][pAdminLevel] >= 1 || playerVariables[playerid][pHelper] >= 1)
- {
- ShowPlayerDialog(playerid, DIALOG_ACOLOR, DIALOG_STYLE_LIST, "Admin Colors", "{ef0031}Red\n{ad0000}Dark Red\n{DB464E}Light Red", "Select", "Cancel");
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement