Advertisement
Guest User

Script admin color

a guest
Dec 29th, 2015
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.42 KB | None | 0 0
  1. #include                <a_samp>
  2. #include                <zcmd>
  3. #include                <foreach>
  4.  
  5. #define DIALOG_ACOLOR (19000)
  6.  
  7. enum playervEnum { pAColor }
  8.  
  9. new playerVariables[MAX_PLAYERS][playervEnum];
  10.  
  11. stock nearByMessage(playerid, color, string[], Float: Distance3 = 12.0) {
  12.     new
  13.         Float: nbCoords[3];
  14.  
  15.     GetPlayerPos(playerid, nbCoords[0], nbCoords[1], nbCoords[2]);
  16.  
  17.     foreach(Player, i) {
  18.             if(IsPlayerInRangeOfPoint(i, Distance3, nbCoords[0], nbCoords[1], nbCoords[2]) && (GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))) {
  19.                 SendClientMessage(i, color, string);
  20.             }
  21.     }
  22.  
  23.     return 1;
  24. }
  25.  
  26. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  27. {
  28.     switch(dialogid)
  29.     {
  30.         case DIALOG_ACOLOR:
  31.         {
  32.             if(response)
  33.             {
  34.                 switch(listitem)
  35.                 {
  36.                     case 0:
  37.                     {
  38.                         {
  39.                             playerVariables[playerid][pAColor] = 1;
  40.                             SendClientMessage(playerid, -1, "{ef0031}Server: {FFFFFF}Nick color changed. Hope you like the new color!");
  41.                         }
  42.                     }
  43.                     case 1:
  44.                     {
  45.                         {
  46.                             playerVariables[playerid][pAColor] = 2;
  47.                             SendClientMessage(playerid, -1, "{ad0000}Server: {FFFFFF}Nick color changed. Hope you like the new color!");
  48.                         }
  49.                     }
  50.                     case 2:
  51.                     {
  52.                         {
  53.                             playerVariables[playerid][pAColor] = 3;
  54.                             SendClientMessage(playerid, -1, "{9d299d}Server: {FFFFFF}Nick color changed. Hope you like          the new color!");
  55.                         }
  56.                     }
  57.                 }
  58.             }
  59.         }
  60.     return 1;
  61. }
  62.  
  63. public OnPlayerText(playerid, text[])
  64. {
  65.                 if(playerVariables[playerid][pAColor] == 1) format(szMessage, sizeof(szMessage), "{ef0031}%s:{FFFFFF} %s", szPlayerName, text);
  66.                 if(playerVariables[playerid][pAColor] == 2) format(szMessage, sizeof(szMessage), "{ad0000}%s:{FFFFFF} %s", szPlayerName, text);
  67.                 if(playerVariables[playerid][pAColor] == 3) format(szMessage, sizeof(szMessage), "{DB464E}%s:{FFFFFF} %s", szPlayerName, text);
  68.                 nearByMessage(playerid, COLOR_GREY, szMessage);
  69.                 format(szMessage, sizeof(szMessage), "\"%s\"", text);
  70.                 SetPlayerChatBubble(playerid, szMessage, COLOR_CHATBUBBLE, 10.0, 10000);   
  71.     return 1;
  72. }
  73.  
  74. CMD:acolor(playerid, params[])
  75. {
  76.     if(playerVariables[playerid][pAdminLevel] >= 1 || playerVariables[playerid][pHelper] >= 1)
  77.     {
  78.         ShowPlayerDialog(playerid, DIALOG_ACOLOR, DIALOG_STYLE_LIST, "Admin Colors", "{ef0031}Red\n{ad0000}Dark Red\n{DB464E}Light Red", "Select", "Cancel");
  79.     }
  80.     return 1;
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement