Guest User

Untitled

a guest
Feb 20th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.23 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <colorchat>
  3. #include <fun>
  4.  
  5. #define VERSION "1.0"
  6.  
  7. new const szPrefix[] = "[Glow]"
  8.  
  9. new const g_szGlowMenuColors[11][] =
  10. {
  11.     "Red",
  12.     "Green",
  13.     "Blue",
  14.     "Yellow",
  15.     "Orange",
  16.     "Purple",
  17.     "White",
  18.     "Pink",
  19.     "Light Blue",
  20.     "Light Green",
  21.     "Disable Glow"
  22. }
  23.  
  24. new const g_szGlowMenuColorCodes[11][3] =
  25. {
  26.     {255, 0, 0},
  27.     {0, 255, 0},
  28.     {0, 0, 255},
  29.     {255, 255, 0},
  30.     {255, 165, 0},
  31.     {128, 0, 128},
  32.     {255, 255, 255},
  33.     {255, 192, 203},
  34.     {173, 216, 230},
  35.     {193, 255, 193},
  36.     {0, 0, 0}
  37. }
  38.  
  39. new p_cvarToggleGlowMenu, szName[33], menu
  40.  
  41. public plugin_init()
  42. {
  43.     register_plugin("Glow Menu", VERSION, "NapoleoN#")
  44.     register_clcmd("say /glow", "glowmenu")
  45.     register_clcmd("say /glowmenu", "glowmenu")
  46.     register_clcmd("say_team /glow", "glowmenu")
  47.     register_clcmd("say_teal /glowmenu", "glowmenu")
  48.    
  49.     p_cvarToggleGlowMenu = register_cvar("amx_toggleglow", "1")
  50. }
  51.  
  52. public client_putinserver(id)
  53. {
  54.     set_task(30.0, "ShowMessage", id)
  55. }
  56.  
  57. public ShowMessage(id)
  58. {
  59.     get_user_name(id, szName, charsmax(szName))
  60.    
  61.     if(is_user_connected(id))
  62.     {
  63.         ColorChat(id, GREEN, "%s^x01 Welcome to our server^x03 %s^x01. Type /glow to open the^x04 GlowMenu.", szPrefix, szName)
  64.     }
  65. }
  66.  
  67. public glowmenu(id)
  68. {
  69.     if(!get_pcvar_num(p_cvarToggleGlowMenu))
  70.     {
  71.         return PLUGIN_HANDLED
  72.     }
  73.    
  74.     if(is_user_connected(id))
  75.     {
  76.         menu = menu_create("\yGlow\r Menu\d |\r Advanced\y Colors\w!", "menu_handler")
  77.        
  78.         new szTemp[500], Key[6]
  79.        
  80.         for(new i = 0; i < sizeof(g_szGlowMenuColors); i++)
  81.         {
  82.             formatex(szTemp, charsmax(szTemp), "\y%s", g_szGlowMenuColors[i])
  83.             num_to_str(i, Key, charsmax(Key))
  84.             menu_additem(menu, szTemp, Key)
  85.         }
  86.         menu_display(id, menu)
  87.     }
  88.     else if(!is_user_connected(id))
  89.     {
  90.         return PLUGIN_HANDLED
  91.     }
  92.     return PLUGIN_CONTINUE
  93. }
  94.  
  95. public menu_handler(id, menu, item)
  96. {
  97.     if(!is_user_connected(id) || !get_pcvar_num(p_cvarToggleGlowMenu))
  98.     {
  99.         return PLUGIN_HANDLED
  100.     }
  101.    
  102.     ColorChat(id, GREEN, "%s^x03 %s^x01 has choosen the glow color:^x04 %s", szPrefix, szName, g_szGlowMenuColors[item])
  103.     set_user_rendering(id,kRenderFxGlowShell, g_szGlowMenuColorCodes[item][0], g_szGlowMenuColorCodes[item][1], g_szGlowMenuColorCodes[item][2], kRenderNormal, 25)
  104.    
  105.     return PLUGIN_CONTINUE
  106. }
Add Comment
Please, Sign In to add comment