PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <cstrike>
#include < fakemeta >
#include < engine >
#include < fun >
#include < hamsandwich >
#include <vip>
enum Color
{
NORMAL = 1, // clients scr_concolor cvar color
GREEN, // Green Color
TEAM_COLOR, // Red, grey, blue
GREY, // grey
RED, // Red
BLUE, // Blue
}
new TeamName[][] =
{
"",
"TERRORIST",
"CT",
"SPECTATOR"
}
#define PLUGIN "Jailbreak Glow Menu"
#define VERSION "3.0"
#define AUTHOR "fLaXXIE"
new const prefix[] = "^4[VIP] Glow:^3"
new iBool[33]
new g_iTargR = 255, g_iTargG, g_iTargB
new R[33], G[33], B[33]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /glow", "MainMenu") // Command for opening the glow menu.
register_clcmd("say /glowmenu", "MainMenu") // Command for opening the glow menu.
register_clcmd("say /gm", "MainMenu") // Command for opening the glow menu.
}
public MainMenu(iPlayer)
{
if (is_user_alive(iPlayer) && is_user_vip(iPlayer))
{
ColorMenu(iPlayer)
}
else ColorChat(iPlayer, GREY, "%s Only Alive Players can use the glow menu.", prefix)
return PLUGIN_HANDLED
}
public ColorMenu(iPlayer)
{
new sub = menu_create("\wVip Glow Menu^n\wSelection", "ColorMenu_Handle")
menu_additem(sub, "\wNone Glow", "0", 0)
menu_additem(sub, "\wRed Glow", "1", 0)
menu_additem(sub, "\wBlue Glow", "2", 0)
menu_additem(sub, "\wWhite Glow", "3", 0)
menu_additem(sub, "\wGreen Glow", "4", 0)
menu_additem(sub, "\wYellow Glow", "5", 0)
menu_additem(sub, "\wPurple Glow", "6", 0)
menu_additem(sub, "\wPurple Glow (\d Weird\w )", "7", 0)
menu_additem(sub, "\wCyan Glow", "8", 0)
menu_additem(sub, "\wBlue Glow (\d Weird\w )", "9", 0)
menu_additem(sub, "\wRainbow Glow", "10", 0)
menu_setprop(sub, MPROP_EXIT, MEXIT_ALL)
menu_display(iPlayer, sub)
}
public ColorMenu_Handle(iPlayer, sub, item)
{
if (item == MENU_EXIT)
{
menu_destroy(sub)
return PLUGIN_HANDLED
}
new Data[7]
new Access, Callback
menu_item_getinfo(sub, item, Access, Data, 5, _, _, Callback)
new key = str_to_num(Data)
switch (key)
{
case 0:
{
iBool[iPlayer] = false
set_user_rendering(iPlayer, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 255)
ColorChat(iPlayer, GREY, "%s Glow Has Been Disactived", prefix )
}
case 1:
{
iBool[iPlayer] = false
set_user_rendering(iPlayer, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 255)
ColorChat(iPlayer, GREY, "%s now has a ^4Red Glow^3!", prefix )
}
case 2:
{
iBool[iPlayer] = false
set_user_rendering(iPlayer, kRenderFxGlowShell, 0, 0, 255, kRenderNormal, 255)
ColorChat(iPlayer, GREY, "%s now has a ^4Blue Glow^3!", prefix )
}
case 3:
{
iBool[iPlayer] = false
set_user_rendering(iPlayer, kRenderFxGlowShell, 255, 255, 255, kRenderNormal, 255)
ColorChat(iPlayer, GREY, "%s now has a ^4White Glow^3!", prefix )
}
case 4:
{
iBool[iPlayer] = false
set_user_rendering(iPlayer, kRenderFxGlowShell, 0, 255, 0, kRenderNormal, 255)
ColorChat(iPlayer, GREY, "%s now has a ^4Green Glow^3!", prefix)
}
case 5:
{
iBool[iPlayer] = false
set_user_rendering(iPlayer, kRenderFxGlowShell, 255, 255, 0, kRenderNormal, 255)
ColorChat(iPlayer, GREY, "%s now has a ^4Yellow Glow^3!", prefix)
}
case 6:
{
iBool[iPlayer] = false
set_user_rendering(iPlayer, kRenderFxGlowShell, 255, 0, 180, kRenderNormal, 255)
ColorChat(iPlayer, GREY, "%s now has a ^4Purple Glow^3!", prefix)
}
case 7:
{
iBool[iPlayer] = false
set_user_rendering(iPlayer, kRenderFxGlowShell, 173, 054, 255, kRenderNormal, 255)
ColorChat(iPlayer, GREY, "%s now has a ^4Purple Glow^3 (^4 Weird^3 )!", prefix)
}
case 8:
{
iBool[iPlayer] = false
set_user_rendering(iPlayer, kRenderFxGlowShell, 0, 255, 255, kRenderNormal, 255)
ColorChat(iPlayer, GREY, "%s now has a ^4Cyan Glow^3!", prefix)
}
case 9:
{
iBool[iPlayer] = false
set_user_rendering(iPlayer, kRenderFxGlowShell, 0, 131, 255, kRenderNormal, 255)
ColorChat(iPlayer, GREY, "%s now has a ^4Blue Glow^3 (^4 Weird^3 )!", prefix)
}
case 10:
{
if(!iBool[iPlayer])
{
iBool[iPlayer] = true
ColorChat(iPlayer, GREY, "%s ^4Rainbow Glow^1Activated!", prefix)
set_task(0.1, "RainbowGlow", iPlayer, _, _, "b")
}
else
{
iBool[iPlayer] = false
set_user_rendering(iPlayer, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 255)
ColorChat(iPlayer, GREY, "%s ^4Rainbow Glow ^1Disabled!", prefix)
}
}
}
return PLUGIN_HANDLED
}
public RainbowGlow(id)
{
if(!iBool[id]) return
if( R[id] >= 255 && B[id] <= 0 ) {g_iTargG = 255; g_iTargB = 0;} // Red -> Yellow
if( G[id] >= 255 && R[id] >= 255 ) {g_iTargR = 0;} // Yellow -> Green
// Takes too long to visually transition:
if( G[id] >= 255 && R[id] <= 0 ) {g_iTargB = 255;} // Green to Turquoise
if( B[id] >= 255 && G[id] >= 255 ) {g_iTargG = 0;} // Turquoise to Blue
if( B[id] >= 255 && G[id] <= 0 ) {g_iTargR = 255;} // Blue to Purple
if( B[id] >= 255 && R[id] >= 255 ) {g_iTargB = 0;} // Purple to Red
if ( R[id] < g_iTargR ) R[id] += 10
else if ( R[id] > g_iTargR ) R[id] -= 10
if ( G[id] < g_iTargG ) G[id] += 10
else if ( G[id] > g_iTargG ) G[id] -= 10
if ( B[id] < g_iTargB ) B[id] += 10
else if ( B[id] > g_iTargB ) B[id] -= 10
if( R[id] < 0 ) R[id] = 0
if( G[id] < 0 ) G[id] = 0
if( B[id] < 0 ) B[id] = 0
if( R[id] > 255 ) R[id] = 255
if( G[id] > 255 ) G[id] = 255
if( B[id] > 255 ) B[id] = 255
set_user_rendering(id, kRenderFxGlowShell, R[id], G[id], B[id], kRenderNormal, 255)
}
ColorChat(id, Color:type, const msg[], {Float,Sql,Result,_}:...)
{
static message[256];
switch(type)
{
case NORMAL: // clients scr_concolor cvar color
{
message[0] = 0x01;
}
case GREEN: // Green
{
message[0] = 0x04;
}
default: // White, Red, Blue
{
message[0] = 0x03;
}
}
vformat(message[1], 251, msg, 4);
// Make sure message is not longer than 192 character. Will crash the server.
message[192] = '^0';
static team, ColorChange, index, MSG_Type;
if(id)
{
MSG_Type = MSG_ONE;
index = id;
} else {
index = FindPlayer();
MSG_Type = MSG_ALL;
}
team = get_user_team(index);
ColorChange = ColorSelection(index, MSG_Type, type);
ShowColorMessage(index, MSG_Type, message);
if(ColorChange)
{
Team_Info(index, MSG_Type, TeamName[team]);
}
}
ShowColorMessage(id, type, message[])
{
message_begin(type, get_user_msgid("SayText"), _, id);
write_byte(id)
write_string(message);
message_end();
}
Team_Info(id, type, team[])
{
message_begin(type, get_user_msgid("TeamInfo"), _, id);
write_byte(id);
write_string(team);
message_end();
return 1;
}
ColorSelection(index, type, Color:Type)
{
switch(Type)
{
case RED:
{
return Team_Info(index, type, TeamName[1]);
}
case BLUE:
{
return Team_Info(index, type, TeamName[2]);
}
case GREY:
{
return Team_Info(index, type, TeamName[0]);
}
}
return 0;
}
FindPlayer()
{
static i;
i = -1;
while(i <= get_maxplayers())
{
if(is_user_connected(++i))
{
return i;
}
}
return -1;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ fbidis\\ ansi\\ ansicpg1252\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset0 Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ ltrpar\\ lang1037\\ f0\\ fs16 \n\\ par }
*/