Code is hugly as f, but it should work. I had to script.
PHP Code:
#include <sourcemod>
#include <adminmenu>
#pragma semicolon 1
#pragma tabsize 0
public Plugin myinfo = {
name = "Simple Body Colors",
author = "TheUnderTaker",
description = "Allow you to color yourself by a command.",
version = "1.0",
url = "http://steamcommunity.com/id/theundertaker007/"
};
public OnPluginStart()
{
RegConsoleCmd("sm_bodycolor", Colors);
RegConsoleCmd("sm_bodycolors", Colors);
}
public Action:Colors(client, args)
{
new Handle:menu = CreateMenu(MenuHandler_Colorize);
SetMenuTitle(menu, "Choose a player");
SetMenuExitBackButton(menu, true);
AddTargetsToMenu(menu, 0, true, false);
DisplayMenu(menu, client, MENU_TIME_FOREVER);
}
public MenuHandler_Colorize(Handle:menu, MenuAction:action, client, item)
{
if(action == MenuAction_Select)
{
decl String:item_name[64];
GetMenuItem(menu, item, item_name, sizeof(item_name));
new Handle:colors = CreateMenu(ColorCallback, MenuAction_Select | MenuAction_End | MenuAction_DisplayItem);
SetMenuTitle(colors, "Color Body Menu");
AddMenuItem(colors, "x", "------------------", ITEMDRAW_DISABLED);
AddMenuItem(colors, item_name, "Remove Color");
AddMenuItem(colors, item_name, "Green");
AddMenuItem(colors, item_name, "Red");
AddMenuItem(colors, item_name, "Blue");
AddMenuItem(colors, item_name, "Gold");
AddMenuItem(colors, item_name, "Black");
AddMenuItem(colors, item_name, "Cyan");
AddMenuItem(colors, item_name, "Turquoise");
AddMenuItem(colors, item_name, "Sky as Blue");
AddMenuItem(colors, item_name, "Dodger Blue");
AddMenuItem(colors, item_name, "Yellow");
AddMenuItem(colors, item_name, "Pink");
AddMenuItem(colors, item_name, "Purple");
AddMenuItem(colors, item_name, "Gray");
DisplayMenu(colors, client, MENU_TIME_FOREVER);
}
else
{
CloseHandle(menu);
}
}
public ColorCallback(Handle:menu, MenuAction:action, client, item)
{
switch(action)
{
case MenuAction_Select:
{
decl String:item_name[64];
GetMenuItem(menu, item, item_name, sizeof(item_name));
client = StringToInt(item_name);
if(item == 0)
{
SetEntityRenderColor(client, 255, 255, 255, 255);
PrintToChat(client, "You removed your color successfully.");
}
else if(item == 01)
{
SetEntityRenderColor(client, 0, 255, 0, 255);
PrintToChat(client, "You changed your color to Green.");
}
else if(item == 02)
{
SetEntityRenderColor(client, 255, 0, 0, 255);
PrintToChat(client, "You changed your color to Red.");
}
else if(item == 03)
{
SetEntityRenderColor(client, 0, 0, 255, 255);
PrintToChat(client, "You changed your color to Blue.");
}
else if(item == 04)
{
SetEntityRenderColor(client, 255, 215, 0, 255);
PrintToChat(client, "You changed your color to Gold.");
}
else if(item == 05)
{
SetEntityRenderColor(client, 0, 0, 0, 255);
PrintToChat(client, "You changed your color to Black.");
}
else if(item == 06)
{
SetEntityRenderColor(client, 0, 255, 255, 255);
PrintToChat(client, "You changed your color to Cyan.");
}
else if(item == 07)
{
SetEntityRenderColor(client, 64, 224, 208, 255);
PrintToChat(client, "You changed your color to Turquoise.");
}
else if(item == 08)
{
SetEntityRenderColor(client, 0, 191, 255, 255);
PrintToChat(client, "You changed your color to Sky as Blue.");
}
else if(item == 091)
{
SetEntityRenderColor(client, 30, 144, 255, 255);
PrintToChat(client, "You changed your color to Dodger Blue.");
}
else if(item == 10)
{
SetEntityRenderColor(client, 255, 255, 0, 255);
PrintToChat(client, "You changed your color to Yellow.");
}
else if(item == 011)
{
SetEntityRenderColor(client, 255, 105, 180, 255);
PrintToChat(client, "You changed your color to Pink.");
}
else if(item == 012)
{
SetEntityRenderColor(client, 128, 0, 128, 255);
PrintToChat(client, "You changed your color to Purple.");
}
else if(item == 013)
{
SetEntityRenderColor(client, 128, 128, 128, 255);
PrintToChat(client, "You changed your color to Gray.");
}
}
case MenuAction_End:
{
CloseHandle(menu);
}
}
}