PDA

View Full Version : [REQ][CS:GO] Simple Body Colors on "TARGET"


Raw123
07-08-2016, 18:17
Hello i need something like "Set Target Color". I found one plugin, but this is only for myself.
I want to see menu ingame with Clients and make a possibility set them color.


The author seems inactive.
Plugin: https://forums.alliedmods.net/showthread.php?p=2331456

Arkarr
07-09-2016, 12:24
Code is hugly as f, but it should work. I had to script.

#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);
}
}
}

Raw123
07-10-2016, 08:07
Code is hugly as f, but it should work. I had to script.

#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);
}
}
}


Its not Working my friend. :(

Arkarr
07-10-2016, 10:42
Its not Working my friend. :(
What do you excpet then ? Help ? I won't if you give me no more then "not working m8 pliz fix".

EDIT : noticed the MP, don't send me private message for fixing things that you started by youself. post in thread instend ;)

Raw123
07-10-2016, 11:51
What do you excpet then ? Help ? I won't if you give me no more then "not working m8 pliz fix".

EDIT : noticed the MP, don't send me private message for fixing things that you started by youself. post in thread instend ;)

Sorry, I didn't mean that. Could you please help me with it? It's working but not properly
, and I'm not good at pawn studio so I can't fix it. please and thank you anyway.