Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <colorchat>
- #include <fun>
- #define VERSION "1.0"
- new const szPrefix[] = "[Glow]"
- new const g_szGlowMenuColors[11][] =
- {
- "Red",
- "Green",
- "Blue",
- "Yellow",
- "Orange",
- "Purple",
- "White",
- "Pink",
- "Light Blue",
- "Light Green",
- "Disable Glow"
- }
- new const g_szGlowMenuColorCodes[11][3] =
- {
- {255, 0, 0},
- {0, 255, 0},
- {0, 0, 255},
- {255, 255, 0},
- {255, 165, 0},
- {128, 0, 128},
- {255, 255, 255},
- {255, 192, 203},
- {173, 216, 230},
- {193, 255, 193},
- {0, 0, 0}
- }
- new p_cvarToggleGlowMenu, szName[33], menu
- public plugin_init()
- {
- register_plugin("Glow Menu", VERSION, "NapoleoN#")
- register_clcmd("say /glow", "glowmenu")
- register_clcmd("say /glowmenu", "glowmenu")
- register_clcmd("say_team /glow", "glowmenu")
- register_clcmd("say_teal /glowmenu", "glowmenu")
- p_cvarToggleGlowMenu = register_cvar("amx_toggleglow", "1")
- }
- public client_putinserver(id)
- {
- set_task(30.0, "ShowMessage", id)
- }
- public ShowMessage(id)
- {
- get_user_name(id, szName, charsmax(szName))
- if(is_user_connected(id))
- {
- ColorChat(id, GREEN, "%s^x01 Welcome to our server^x03 %s^x01. Type /glow to open the^x04 GlowMenu.", szPrefix, szName)
- }
- }
- public glowmenu(id)
- {
- if(!get_pcvar_num(p_cvarToggleGlowMenu))
- {
- return PLUGIN_HANDLED
- }
- if(is_user_connected(id))
- {
- menu = menu_create("\yGlow\r Menu\d |\r Advanced\y Colors\w!", "menu_handler")
- new szTemp[500], Key[6]
- for(new i = 0; i < sizeof(g_szGlowMenuColors); i++)
- {
- formatex(szTemp, charsmax(szTemp), "\y%s", g_szGlowMenuColors[i])
- num_to_str(i, Key, charsmax(Key))
- menu_additem(menu, szTemp, Key)
- }
- menu_display(id, menu)
- }
- else if(!is_user_connected(id))
- {
- return PLUGIN_HANDLED
- }
- return PLUGIN_CONTINUE
- }
- public menu_handler(id, menu, item)
- {
- if(!is_user_connected(id) || !get_pcvar_num(p_cvarToggleGlowMenu))
- {
- return PLUGIN_HANDLED
- }
- ColorChat(id, GREEN, "%s^x03 %s^x01 has choosen the glow color:^x04 %s", szPrefix, szName, g_szGlowMenuColors[item])
- set_user_rendering(id,kRenderFxGlowShell, g_szGlowMenuColorCodes[item][0], g_szGlowMenuColorCodes[item][1], g_szGlowMenuColorCodes[item][2], kRenderNormal, 25)
- return PLUGIN_CONTINUE
- }
Add Comment
Please, Sign In to add comment