Raised This Month: $32 Target: $400
 8% 

What am I doing wrong?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ice_MMB
Junior Member
Join Date: Jul 2017
Old 07-28-2017 , 02:28   What am I doing wrong?
Reply With Quote #1

Help me please i'm trying to edit this plugin to have a double selection menu an option for name color and another option for color chat but i'm having these complilation errors.

Ignore parts written in Brazilian Portuguese they are just texts

PHP Code:
#include <sourcemod>
#include <clientprefs>
#include <scp>
#include <colors_csgo>

#pragma semicolon 1
#pragma dynamic 131072

#define PLUGIN_VERSION "1.0"

Handle gH_Cookie INVALID_HANDLE;
Handle gH_Cookie2 INVALID_HANDLE;
Handle gH_Cookie3 INVALID_HANDLE;
Handle gH_Cookie4 INVALID_HANDLE;
Handle g_hMenuCS INVALID_HANDLE;
Handle g_hMenuCN INVALID_HANDLE;
Handle g_hMenuCC INVALID_HANDLE;

public 
Plugin:myinfo =
{
    
name "hP Chat",
    
author "Shavit + AntiTeal + Ice_",
    
description "Custom tags, chat colors, & name colors.",
    
version PLUGIN_VERSION,
    
url "https://forums.alliedmods.net/, http://steamcommunity.com/profiles/76561198117802354"
}


public 
OnPluginStart()
{
    
g_hMenuCS CreateMenu(MenuSelectHandler);
        
SetMenuTitle(hMenu"Escolha o que quer colorir");
        
AddMenuItem(hMenu"ChatColors""Chat");
        
AddMenuItem(hMenu"NameColors""Nome");
        
SetMenuExitButton(hMenutrue);
        
DisplayMenu(hMenuclient20);

    
g_hMenuCC CreateMenu(MenuHandler_ColorsMENU_ACTIONS_ALL);
        
SetMenuTitle(hMenu"Selecione a cor do chat:");
        
AddMenuItem(hMenu"none""Padrão");
        
AddMenuItem(hMenu"\x02""Vermelho");
        
AddMenuItem(hMenu"\x03""Cor do Time");
        
AddMenuItem(hMenu"\x04""Verde");
        
AddMenuItem(hMenu"\x05""Verde Claro");
        
AddMenuItem(hMenu"\x06""Limão");
        
AddMenuItem(hMenu"\x07""Vermelho Claro");
        
AddMenuItem(hMenu"\x08""Cinza");
        
AddMenuItem(hMenu"\x09""Oliva");
        
AddMenuItem(hMenu"\x0B""Azul Claro");
        
AddMenuItem(hMenu"\x0C""Azul");
        
AddMenuItem(hMenu"\x0C""Roxo");
        
AddMenuItem(hMenu"\x0E""Rosa");
        
AddMenuItem(hMenu"\x10""Dourado");
        
AddMenuItem(hMenu"\x0F""Laranja");
        
SetMenuExitButton(hMenutrue);
        
DisplayMenu(hMenuclient20);

    
g_hMenuCN CreateMenu(MenuHandler_NameColorMENU_ACTIONS_ALL);
        
SetMenuTitle(hMenu"Selecione a cor do nome:");
        
AddMenuItem(hMenu"none""Padrão");
        
AddMenuItem(hMenu"\x02""Vermelho");
        
AddMenuItem(hMenu"\x03""Cor do Time");
        
AddMenuItem(hMenu"\x04""Verde");
        
AddMenuItem(hMenu"\x05""Verde Claro");
        
AddMenuItem(hMenu"\x06""Limão");
        
AddMenuItem(hMenu"\x07""Vermelho Claro");
        
AddMenuItem(hMenu"\x08""Cinza");
        
AddMenuItem(hMenu"\x09""Oliva");
        
AddMenuItem(hMenu"\x0B""Azul Claro");
        
AddMenuItem(hMenu"\x0C""Azul");
        
AddMenuItem(hMenu"\x0C""Roxo");
        
AddMenuItem(hMenu"\x0E""Rosa");
        
AddMenuItem(hMenu"\x10""Dourado");
        
AddMenuItem(hMenu"\x0F""Laranja");
        
SetMenuExitButton(hMenutrue);
        
DisplayMenu(hMenuclient20);

        
gH_Cookie RegClientCookie("sm_chatcolors_cookie""Contains the used chat color"CookieAccess_Protected);
        
gH_Cookie2 RegClientCookie("sm_chattag_cookie""Contains the used chat tag."CookieAccess_Protected);
        
gH_Cookie3 RegClientCookie("sm_suffix_cookie""Contains the used chat suffix."CookieAccess_Protected);
        
RegAdminCmd("sm_sufixo"Command_SuffixADMFLAG_GENERIC"Allows the player to change their ChatTag.");
        
gH_Cookie4 RegClientCookie("sm_namecolor_cookie""Contains the used name color"CookieAccess_Protected);
        
CreateConVar("sm_chatextender_version"PLUGIN_VERSION"Plugin version"FCVAR_DONTRECORD|FCVAR_NOTIFY);
    
RegAdminCmd("sm_cores"Command_MenusADMFLAG_ROOT);
}

public 
Action Command_Menus(int clientint args)
{
    if (
client 0)
    {
        
DisplayMenu(g_hMenuCSclient20);
    }

    return 
Plugin_Handled;
}

public 
MenuSelectHandler(Handle hMenuMenuAction maActionint clientint choice)
{
    if (
maAction == MenuAction_Select)
    {
            if(
StrEqual(sChoice"ChatColors"))
            {
                
DisplayMenu(g_hMenuCCclient20);
            }
            if(
StrEqual(sChoice"NameColors"))
            {
                
DisplayMenu(g_hMenuCNclient20);
            }
            else if(
maAction == MenuAction_End)
            {
                
CloseHandle(hMenu);
            }
    }
}
public 
int MenuHandler_Colors(Handle hMenuMenuAction maActionint clientint choice)
{
    if(
maAction == MenuAction_Select)
    {
        
char sChoice[8];
        
GetMenuItem(hMenuchoicesChoice8);

        if(
StrEqual(sChoice"none"))
        {
            
FormatEx(sChoice8"\x01");
        }

        if(
StrEqual(sChoice"\x03"))
        {
            
CPrintToChat(client" \x0C[hP Chat]\x01 A cor do seu chat combinará com a cor da sua equipe.");
        }

        else
        {
            
CPrintToChat(client" \x0C[hP Chat]\x01 Você selecionou %sesta cor\x01."sChoice);
        }
        
SetClientCookie(clientgH_CookiesChoice);
    }

    else if(
maAction == MenuAction_End)
    {
        
CloseHandle(hMenu);
    }
}

public 
int MenuHandler_NameColor(Handle hMenuMenuAction maActionint clientint choice)
{
    if(
maAction == MenuAction_Select)
    {
        
char sChoice[8];
        
GetMenuItem(hMenuchoicesChoice8);

        
SetClientCookie(clientgH_Cookie4sChoice);

        if(
StrEqual(sChoice"none"))
        {
            
FormatEx(sChoice8"\x01");
        }

        if(
StrEqual(sChoice"\x03"))
        {
            
CPrintToChat(client" \x0C[hP Chat]\x01 Sua cor do seu nome combinará com a cor da sua equipe.");
        }

        else
        {
            
CPrintToChat(client" \x0C[hP Chat]\x01 Você selecionou %sesta cor\x01."sChoice);
        }
    }

    else if(
maAction == MenuAction_End)
    {
        
CloseHandle(hMenu);
    }
}

stock bool:IsValidClient(client) {
    return (
client && client <= MaxClients);
}
public 
Action Command_Tag(int clientint args)
{
    if (
IsValidClient(client))
    {
        if (
args 1)
        {
            
ReplyToCommand(client"\x0C[hP Chat]\x01 Uso: sm_tag <tag>.");
            return 
Plugin_Handled;
        }

        
char arg[32];
        
GetCmdArg(1argsizeof(arg));

        
ReplaceString(argsizeof(arg), "{teamcolor}""\x03"false);

        
SetClientCookie(clientgH_Cookie2arg);

        if(
StrEqual(arg"none"false))
        {
            
CPrintToChat(client" \x0B[hP Chat]\x01 Você removeu sua tag.");
            return 
Plugin_Handled;
        }

        
CPrintToChat(client" \x0B[hP Chat]\x01 Você selecionou a tag: '%s\x01'."arg);

        return 
Plugin_Handled;
    }
    return 
Plugin_Handled;
}
public 
Action Command_Suffix(int clientint args)
{
    if (
IsValidClient(client))
    {
        if (
args 1)
        {
            
ReplyToCommand(client"\x0C[hP Chat]\x01 Uso: sm_sufixo <tag>.");
            return 
Plugin_Handled;
        }

        
char arg[32];
        
GetCmdArg(1argsizeof(arg));

        
ReplaceString(argsizeof(arg), "{teamcolor}""\x03"false);

        
SetClientCookie(clientgH_Cookie3arg);

        if(
StrEqual(arg"none"false))
        {
            
CPrintToChat(client" \x0B[hP Chat]\x01 Você removeu seu sufixo.");
            return 
Plugin_Handled;
        }

        
CPrintToChat(client" \x0C[hP Chat]\x01 Você selecionou o sufixo: '%s\x01'."arg);

        return 
Plugin_Handled;
    }
    return 
Plugin_Handled;
}
public 
Action OnChatMessage(int &clientHandle hRecipientschar[] sNamechar[] sMessage)
{
    if(
CheckCommandAccess(client"sm_cores"ADMFLAG_GENERIC))
    {
        
char sCookie[8];
        
GetClientCookie(clientgH_CookiesCookiesizeof(sCookie));

        
char sCookie2[32];
        
GetClientCookie(clientgH_Cookie2sCookie2sizeof(sCookie2));

        
char sCookie3[32];
        
GetClientCookie(clientgH_Cookie3sCookie3sizeof(sCookie3));

        
char sCookie4[8];
        
GetClientCookie(clientgH_Cookie4sCookie4sizeof(sCookie4));

        if(
StrEqual(sCookie"") || StrEqual(sCookie"none"))
        {
            if(
StrEqual(sCookie2"") || StrEqual(sCookie2"none"))
            {
                if(
StrEqual(sCookie3"") || StrEqual(sCookie3"none"))
                {
                    if(
StrEqual(sCookie4"") || StrEqual(sCookie4"none"))
                    {
                        return 
Plugin_Continue;
                    }
                }
            }
        }

        if(
StrEqual(sCookie2"") || StrEqual(sCookie2"none"))
        {
            
strcopy(sCookie2sizeof(sCookie2), "");
        }

        if(
StrEqual(sCookie3"") || StrEqual(sCookie3"none"))
        {
            
strcopy(sCookie3sizeof(sCookie3), "");
        }

        if(
StrEqual(sCookie4"") || StrEqual(sCookie4"none"))
        {
            
strcopy(sCookie4sizeof(sCookie3), "\x03");
        }

        
Format(sMessageMAXLENGTH_INPUT"%s%s"sCookiesMessage);
        
CFormat(sMessageMAXLENGTH_INPUT);

        
Format(sNameMAXLENGTH_INPUT"%s%s%s%s"sCookie2sCookie4sNamesCookie3);
        
CFormat(sNameMAXLENGTH_INPUT);

        return 
Plugin_Changed;
    }

    return 
Plugin_Continue;

Error compiling

Code:
//SourceMod Batch Compiler
// by the SourceMod Dev Team


//// colormenuV3.sp
//
// C:\Users\Pichau\Desktop\SteamCMD.GUI\server\steamapps\common\Counter-Strike Global Offensive Beta - Dedicated Server\csgo\addons\sourcemod\scripting\colormenuV3.sp(32) : warning 217: loose indentation
// C:\Users\Pichau\Desktop\SteamCMD.GUI\server\steamapps\common\Counter-Strike Global Offensive Beta - Dedicated Server\csgo\addons\sourcemod\scripting\colormenuV3.sp(32) : error 017: undefined symbol "hMenu"
// C:\Users\Pichau\Desktop\SteamCMD.GUI\server\steamapps\common\Counter-Strike Global Offensive Beta - Dedicated Server\csgo\addons\sourcemod\scripting\colormenuV3.sp(33) : error 017: undefined symbol "hMenu"
// C:\Users\Pichau\Desktop\SteamCMD.GUI\server\steamapps\common\Counter-Strike Global Offensive Beta - Dedicated Server\csgo\addons\sourcemod\scripting\colormenuV3.sp(34) : error 017: undefined symbol "hMenu"
// C:\Users\Pichau\Desktop\SteamCMD.GUI\server\steamapps\common\Counter-Strike Global Offensive Beta - Dedicated Server\csgo\addons\sourcemod\scripting\colormenuV3.sp(35) : error 017: undefined symbol "hMenu"
// C:\Users\Pichau\Desktop\SteamCMD.GUI\server\steamapps\common\Counter-Strike Global Offensive Beta - Dedicated Server\csgo\addons\sourcemod\scripting\colormenuV3.sp(36) : error 017: undefined symbol "hMenu"
// C:\Users\Pichau\Desktop\SteamCMD.GUI\server\steamapps\common\Counter-Strike Global Offensive Beta - Dedicated Server\csgo\addons\sourcemod\scripting\colormenuV3.sp(38) : warning 217: loose indentation
// C:\Users\Pichau\Desktop\SteamCMD.GUI\server\steamapps\common\Counter-Strike Global Offensive Beta - Dedicated Server\csgo\addons\sourcemod\scripting\colormenuV3.sp(39) : warning 217: loose indentation
// C:\Users\Pichau\Desktop\SteamCMD.GUI\server\steamapps\common\Counter-Strike Global Offensive Beta - Dedicated Server\csgo\addons\sourcemod\scripting\colormenuV3.sp(39) : error 017: undefined symbol "hMenu"
// C:\Users\Pichau\Desktop\SteamCMD.GUI\server\steamapps\common\Counter-Strike Global Offensive Beta - Dedicated Server\csgo\addons\sourcemod\scripting\colormenuV3.sp(40) : error 017: undefined symbol "hMenu"
// C:\Users\Pichau\Desktop\SteamCMD.GUI\server\steamapps\common\Counter-Strike Global Offensive Beta - Dedicated Server\csgo\addons\sourcemod\scripting\colormenuV3.sp(41) : error 017: undefined symbol "hMenu"
// C:\Users\Pichau\Desktop\SteamCMD.GUI\server\steamapps\common\Counter-Strike Global Offensive Beta - Dedicated Server\csgo\addons\sourcemod\scripting\colormenuV3.sp(42) : error 017: undefined symbol "hMenu"
// C:\Users\Pichau\Desktop\SteamCMD.GUI\server\steamapps\common\Counter-Strike Global Offensive Beta - Dedicated Server\csgo\addons\sourcemod\scripting\colormenuV3.sp(43) : error 017: undefined symbol "hMenu"
// C:\Users\Pichau\Desktop\SteamCMD.GUI\server\steamapps\common\Counter-Strike Global Offensive Beta - Dedicated Server\csgo\addons\sourcemod\scripting\colormenuV3.sp(44) : error 017: undefined symbol "hMenu"
// C:\Users\Pichau\Desktop\SteamCMD.GUI\server\steamapps\common\Counter-Strike Global Offensive Beta - Dedicated Server\csgo\addons\sourcemod\scripting\colormenuV3.sp(45) : error 017: undefined symbol "hMenu"
// C:\Users\Pichau\Desktop\SteamCMD.GUI\server\steamapps\common\Counter-Strike Global Offensive Beta - Dedicated Server\csgo\addons\sourcemod\scripting\colormenuV3.sp(46) : error 017: undefined symbol "hMenu"
// C:\Users\Pichau\Desktop\SteamCMD.GUI\server\steamapps\common\Counter-Strike Global Offensive Beta - Dedicated Server\csgo\addons\sourcemod\scripting\colormenuV3.sp(47) : error 017: undefined symbol "hMenu"
// C:\Users\Pichau\Desktop\SteamCMD.GUI\server\steamapps\common\Counter-Strike Global Offensive Beta - Dedicated Server\csgo\addons\sourcemod\scripting\colormenuV3.sp(48) : error 017: undefined symbol "hMenu"
// C:\Users\Pichau\Desktop\SteamCMD.GUI\server\steamapps\common\Counter-Strike Global Offensive Beta - Dedicated Server\csgo\addons\sourcemod\scripting\colormenuV3.sp(49) : error 017: undefined symbol "hMenu"
// C:\Users\Pichau\Desktop\SteamCMD.GUI\server\steamapps\common\Counter-Strike Global Offensive Beta - Dedicated Server\csgo\addons\sourcemod\scripting\colormenuV3.sp(50) : error 017: undefined symbol "hMenu"
// C:\Users\Pichau\Desktop\SteamCMD.GUI\server\steamapps\common\Counter-Strike Global Offensive Beta - Dedicated Server\csgo\addons\sourcemod\scripting\colormenuV3.sp(51) : error 017: undefined symbol "hMenu"
// C:\Users\Pichau\Desktop\SteamCMD.GUI\server\steamapps\common\Counter-Strike Global Offensive Beta - Dedicated Server\csgo\addons\sourcemod\scripting\colormenuV3.sp(52) : error 017: undefined symbol "hMenu"
// C:\Users\Pichau\Desktop\SteamCMD.GUI\server\steamapps\common\Counter-Strike Global Offensive Beta - Dedicated Server\csgo\addons\sourcemod\scripting\colormenuV3.sp(53) : error 017: undefined symbol "hMenu"
// C:\Users\Pichau\Desktop\SteamCMD.GUI\server\steamapps\common\Counter-Strike Global Offensive Beta - Dedicated Server\csgo\addons\sourcemod\scripting\colormenuV3.sp(54) : error 017: undefined symbol "hMenu"
// C:\Users\Pichau\Desktop\SteamCMD.GUI\server\steamapps\common\Counter-Strike Global Offensive Beta - Dedicated Server\csgo\addons\sourcemod\scripting\colormenuV3.sp(55) : error 017: undefined symbol "hMenu"
// C:\Users\Pichau\Desktop\SteamCMD.GUI\server\steamapps\common\Counter-Strike Global Offensive Beta - Dedicated Server\csgo\addons\sourcemod\scripting\colormenuV3.sp(56) : error 017: undefined symbol "hMenu"
// C:\Users\Pichau\Desktop\SteamCMD.GUI\server\steamapps\common\Counter-Strike Global Offensive Beta - Dedicated Server\csgo\addons\sourcemod\scripting\colormenuV3.sp(58) : warning 217: loose indentation
// C:\Users\Pichau\Desktop\SteamCMD.GUI\server\steamapps\common\Counter-Strike Global Offensive Beta - Dedicated Server\csgo\addons\sourcemod\scripting\colormenuV3.sp(59) : warning 217: loose indentation
// C:\Users\Pichau\Desktop\SteamCMD.GUI\server\steamapps\common\Counter-Strike Global Offensive Beta - Dedicated Server\csgo\addons\sourcemod\scripting\colormenuV3.sp(59) : error 017: undefined symbol "hMenu"
// C:\Users\Pichau\Desktop\SteamCMD.GUI\server\steamapps\common\Counter-Strike Global Offensive Beta - Dedicated Server\csgo\addons\sourcemod\scripting\colormenuV3.sp(60) : error 017: undefined symbol "hMenu"
// C:\Users\Pichau\Desktop\SteamCMD.GUI\server\steamapps\common\Counter-Strike Global Offensive Beta - Dedicated Server\csgo\addons\sourcemod\scripting\colormenuV3.sp(61) : error 017: undefined symbol "hMenu"
//
// Compilation aborted.
// 26 Errors.
//
// Compilation Time: 0,42 sec
// ----------------------------------------

Press enter to exit ...
Ice_MMB is offline
ambn
Veteran Member
Join Date: Feb 2015
Location: Fun servers
Old 07-28-2017 , 02:48   Re: What am I doing wrong?
Reply With Quote #2

The Handle hMenu which is used as a handle for menu to add items , set title is never declared... And those handles you created menu with is also never used..
__________________
ambn is offline
Ice_MMB
Junior Member
Join Date: Jul 2017
Old 07-28-2017 , 11:17   Re: What am I doing wrong?
Reply With Quote #3

Quote:
Originally Posted by ambn View Post
The Handle hMenu which is used as a handle for menu to add items , set title is never declared... And those handles you created menu with is also never used..
But how do I fix this? This is the first time i am using sourcepawn
Ice_MMB is offline
vortex.
AlliedModders Donor
Join Date: Jan 2017
Location: OnGameFrame()
Old 07-28-2017 , 14:15   Re: What am I doing wrong?
Reply With Quote #4

You created a menu handler.
PHP Code:
 g_hMenuCS CreateMenu(MenuSelectHandler); 
But you dont use it. Why? Change h_Menu to g_hMenuCS

And this is not the only mistake.

Quote:
Originally Posted by ambn View Post
The Handle hMenu which is used as a handle for menu to add items , set title is never declared... And those handles you created menu with is also never used..

I think, You should examine other plugins.
__________________

Last edited by vortex.; 07-28-2017 at 14:20.
vortex. is offline
Ice_MMB
Junior Member
Join Date: Jul 2017
Old 07-28-2017 , 17:11   Re: What am I doing wrong?
Reply With Quote #5

Quote:
Originally Posted by vortex. View Post
You created a menu handler.
PHP Code:
 g_hMenuCS CreateMenu(MenuSelectHandler); 
But you dont use it. Why? Change h_Menu to g_hMenuCS

And this is not the only mistake.




I think, You should examine other plugins.
I made some changes

PHP Code:
#include <sourcemod>
#include <clientprefs>
#include <scp>
#include <colors_csgo>

#pragma semicolon 1/
#pragma dynamic 131072

#define PLUGIN_VERSION "1.0"

Handle gH_Cookie INVALID_HANDLE;
Handle gH_Cookie2 INVALID_HANDLE;
Handle gH_Cookie3 INVALID_HANDLE;
Handle gH_Cookie4 INVALID_HANDLE;

public 
Plugin:myinfo =
{
    
name "hP Chat",
    
author "Shavit + AntiTeal + Ice_",
    
description "Custom tags, chat colors, & name colors.",
    
version PLUGIN_VERSION,
    
url "https://forums.alliedmods.net/, http://steamcommunity.com/profiles/76561198117802354"
}


public 
void OnPluginStart()
{

        
gH_Cookie RegClientCookie("sm_chatcolors_cookie""Contains the used chat color"CookieAccess_Protected);
        
gH_Cookie2 RegClientCookie("sm_chattag_cookie""Contains the used chat tag."CookieAccess_Protected);
        
gH_Cookie3 RegClientCookie("sm_suffix_cookie""Contains the used chat suffix."CookieAccess_Protected);
        
RegAdminCmd("sm_sufixo"Command_SuffixADMFLAG_GENERIC"Allows the player to change their ChatTag.");
        
gH_Cookie4 RegClientCookie("sm_namecolor_cookie""Contains the used name color"CookieAccess_Protected);
        
CreateConVar("sm_chatextender_version"PLUGIN_VERSION"Plugin version"FCVAR_DONTRECORD|FCVAR_NOTIFY);
    
RegAdminCmd("sm_cores"Command_MenusADMFLAG_ROOT);
}

public 
Action Command_Menus(int clientint args)
{
    
Handle g_hMenuCS CreateMenu(MenuSelectHandler);
    
SetMenuTitle(g_hMenuCS"Escolha o que quer colorir");
    
AddMenuItem(g_hMenuCS"ChatColors""Chat");
    
AddMenuItem(g_hMenuCS"NameColors""Nome");
    
SetMenuExitButton(g_hMenuCStrue);
    
DisplayMenu(g_hMenuCSclient20);
}

public 
MenuSelectHandler(Handle g_hMenuCSMenuAction maActionint clientint choice)
{
    if (
maAction == MenuAction_Select)
    {
            if(
StrEqual(sChoice"ChatColors"))
            {
                
Handle g_hMenuCC CreateMenu(MenuHandler_ColorsMENU_ACTIONS_ALL);
                
SetMenuTitle(g_hMenuCC"Selecione a cor do chat:");
                
AddMenuItem(g_hMenuCC"none""Padrão");
                
AddMenuItem(g_hMenuCC"\x02""Vermelho");
                
AddMenuItem(g_hMenuCC"\x03""Cor do Time");
                
AddMenuItem(g_hMenuCC"\x04""Verde");
                
AddMenuItem(g_hMenuCC"\x05""Verde Claro");
                
AddMenuItem(g_hMenuCC"\x06""Limão");
                
AddMenuItem(g_hMenuCC"\x07""Vermelho Claro");
                
AddMenuItem(g_hMenuCC"\x08""Cinza");
                
AddMenuItem(g_hMenuCC"\x09""Oliva");
                
AddMenuItem(g_hMenuCC"\x0B""Azul Claro");
                
AddMenuItem(g_hMenuCC"\x0C""Azul");
                
AddMenuItem(g_hMenuCC"\x0C""Roxo");
                
AddMenuItem(g_hMenuCC"\x0E""Rosa");
                
AddMenuItem(g_hMenuCC"\x10""Dourado");
                
AddMenuItem(g_hMenuCC"\x0F""Laranja");
                
SetMenuExitButton(g_hMenuCCtrue);
                
DisplayMenu(g_hMenuCCclient20);
            }
            if(
StrEqual(sChoice"NameColors"))
            {
                
Handle g_hMenuCN CreateMenu(MenuHandler_NameColorMENU_ACTIONS_ALL);
                
SetMenuTitle(g_hMenuCN"Selecione a cor do nome:");
                
AddMenuItem(g_hMenuCN"none""Padrão");
                
AddMenuItem(g_hMenuCN"\x02""Vermelho");
                
AddMenuItem(g_hMenuCN"\x03""Cor do Time");
                
AddMenuItem(g_hMenuCN"\x04""Verde");
                
AddMenuItem(g_hMenuCN"\x05""Verde Claro");
                
AddMenuItem(g_hMenuCN"\x06""Limão");
                
AddMenuItem(g_hMenuCN"\x07""Vermelho Claro");
                
AddMenuItem(g_hMenuCN"\x08""Cinza");
                
AddMenuItem(g_hMenuCN"\x09""Oliva");
                
AddMenuItem(g_hMenuCN"\x0B""Azul Claro");
                
AddMenuItem(g_hMenuCN"\x0C""Azul");
                
AddMenuItem(g_hMenuCN"\x0C""Roxo");
                
AddMenuItem(g_hMenuCN"\x0E""Rosa");
                
AddMenuItem(g_hMenuCN"\x10""Dourado");
                
AddMenuItem(g_hMenuCN"\x0F""Laranja");
                
SetMenuExitButton(g_hMenuCNtrue);
                
DisplayMenu(g_hMenuCNclient20);
            }
            else if(
maAction == MenuAction_End)
            {
                
CloseHandle(g_hMenuCS);
            }
    }
}
public 
int MenuHandler_Colors(Handle g_hMenuCCMenuAction maActionint clientint choice)
{
    if(
maAction == MenuAction_Select)
    {
        
char sChoice[8];
        
GetMenuItem(g_hMenuCCchoicesChoice8);

        if(
StrEqual(sChoice"none"))
        {
            
FormatEx(sChoice8"\x01");
        }

        if(
StrEqual(sChoice"\x03"))
        {
            
CPrintToChat(client" \x0C[hP Chat]\x01 A cor do seu chat combinará com a cor da sua equipe.");
        }

        else
        {
            
CPrintToChat(client" \x0C[hP Chat]\x01 Você selecionou %sesta cor\x01."sChoice);
        }
        
SetClientCookie(clientgH_CookiesChoice);
    }

    else if(
maAction == MenuAction_End)
    {
        
CloseHandle(g_hMenuCC);
    }
}

public 
int MenuHandler_NameColor(Handle g_hMenuCNMenuAction maActionint clientint choice)
{
    if(
maAction == MenuAction_Select)
    {
        
char sChoice[8];
        
GetMenuItem(g_hMenuCNchoicesChoice8);

        
SetClientCookie(clientgH_Cookie4sChoice);

        if(
StrEqual(sChoice"none"))
        {
            
FormatEx(sChoice8"\x01");
        }

        if(
StrEqual(sChoice"\x03"))
        {
            
CPrintToChat(client" \x0C[hP Chat]\x01 Sua cor do seu nome combinará com a cor da sua equipe.");
        }

        else
        {
            
CPrintToChat(client" \x0C[hP Chat]\x01 Você selecionou %sesta cor\x01."sChoice);
        }
    }

    else if(
maAction == MenuAction_End)
    {
        
CloseHandle(g_hMenuCN);
    }
}

stock bool:IsValidClient(client) {
    return (
client && client <= MaxClients);
}
public 
Action Command_Tag(int clientint args)
{
    if (
IsValidClient(client))
    {
        if (
args 1)
        {
            
ReplyToCommand(client"\x0C[hP Chat]\x01 Uso: sm_tag <tag>.");
            return 
Plugin_Handled;
        }

        
char arg[32];
        
GetCmdArg(1argsizeof(arg));

        
ReplaceString(argsizeof(arg), "{teamcolor}""\x03"false);

        
SetClientCookie(clientgH_Cookie2arg);

        if(
StrEqual(arg"none"false))
        {
            
CPrintToChat(client" \x0B[hP Chat]\x01 Você removeu sua tag.");
            return 
Plugin_Handled;
        }

        
CPrintToChat(client" \x0B[hP Chat]\x01 Você selecionou a tag: '%s\x01'."arg);

        return 
Plugin_Handled;
    }
    return 
Plugin_Handled;
}
public 
Action Command_Suffix(int clientint args)
{
    if (
IsValidClient(client))
    {
        if (
args 1)
        {
            
ReplyToCommand(client"\x0C[hP Chat]\x01 Uso: sm_sufixo <tag>.");
            return 
Plugin_Handled;
        }

        
char arg[32];
        
GetCmdArg(1argsizeof(arg));

        
ReplaceString(argsizeof(arg), "{teamcolor}""\x03"false);

        
SetClientCookie(clientgH_Cookie3arg);

        if(
StrEqual(arg"none"false))
        {
            
CPrintToChat(client" \x0B[hP Chat]\x01 Você removeu seu sufixo.");
            return 
Plugin_Handled;
        }

        
CPrintToChat(client" \x0C[hP Chat]\x01 Você selecionou o sufixo: '%s\x01'."arg);

        return 
Plugin_Handled;
    }
    return 
Plugin_Handled;
}
public 
Action OnChatMessage(int &clientHandle hRecipientschar[] sNamechar[] sMessage)
{
    if(
CheckCommandAccess(client"sm_cores"ADMFLAG_GENERIC))
    {
        
char sCookie[8];
        
GetClientCookie(clientgH_CookiesCookiesizeof(sCookie));

        
char sCookie2[32];
        
GetClientCookie(clientgH_Cookie2sCookie2sizeof(sCookie2));

        
char sCookie3[32];
        
GetClientCookie(clientgH_Cookie3sCookie3sizeof(sCookie3));

        
char sCookie4[8];
        
GetClientCookie(clientgH_Cookie4sCookie4sizeof(sCookie4));

        if(
StrEqual(sCookie"") || StrEqual(sCookie"none"))
        {
            if(
StrEqual(sCookie2"") || StrEqual(sCookie2"none"))
            {
                if(
StrEqual(sCookie3"") || StrEqual(sCookie3"none"))
                {
                    if(
StrEqual(sCookie4"") || StrEqual(sCookie4"none"))
                    {
                        return 
Plugin_Continue;
                    }
                }
            }
        }

        if(
StrEqual(sCookie2"") || StrEqual(sCookie2"none"))
        {
            
strcopy(sCookie2sizeof(sCookie2), "");
        }

        if(
StrEqual(sCookie3"") || StrEqual(sCookie3"none"))
        {
            
strcopy(sCookie3sizeof(sCookie3), "");
        }

        if(
StrEqual(sCookie4"") || StrEqual(sCookie4"none"))
        {
            
strcopy(sCookie4sizeof(sCookie3), "\x03");
        }

        
Format(sMessageMAXLENGTH_INPUT"%s%s"sCookiesMessage);
        
CFormat(sMessageMAXLENGTH_INPUT);

        
Format(sNameMAXLENGTH_INPUT"%s%s%s%s"sCookie2sCookie4sNamesCookie3);
        
CFormat(sNameMAXLENGTH_INPUT);

        return 
Plugin_Changed;
    }

    return 
Plugin_Continue;

Error compiling

Code:
//SourceMod Batch Compiler
// by the SourceMod Dev Team


//// colormenuV3.sp
//
// C:\Users\Pichau\Desktop\SteamCMD.GUI\server\steamapps\common\Counter-Strike Global Offensive Beta - Dedicated Server\csgo\addons\sourcemod\scripting\colormenuV3.sp(35) : warning 217: loose indentation
// C:\Users\Pichau\Desktop\SteamCMD.GUI\server\steamapps\common\Counter-Strike Global Offensive Beta - Dedicated Server\csgo\addons\sourcemod\scripting\colormenuV3.sp(52) : error 017: undefined symbol "sChoice"
// C:\Users\Pichau\Desktop\SteamCMD.GUI\server\steamapps\common\Counter-Strike Global Offensive Beta - Dedicated Server\csgo\addons\sourcemod\scripting\colormenuV3.sp(74) : error 017: undefined symbol "sChoice"
//
// 2 Errors.
//
// Compilation Time: 0,41 sec
// ----------------------------------------

Press enter to exit ...
Ice_MMB is offline
BraveFox
AlliedModders Donor
Join Date: May 2015
Location: Israel
Old 07-28-2017 , 17:55   Re: What am I doing wrong?
Reply With Quote #6

PHP Code:
#include <sourcemod> 
#include <clientprefs> 
#include <scp> 
#include <colors_csgo> 

#pragma semicolon 1/ 
#pragma dynamic 131072 

#define PLUGIN_VERSION "1.0" 

Handle gH_Cookie INVALID_HANDLE
Handle gH_Cookie2 INVALID_HANDLE
Handle gH_Cookie3 INVALID_HANDLE
Handle gH_Cookie4 INVALID_HANDLE

public 
Plugin:myinfo 

    
name "hP Chat"
    
author "Shavit + AntiTeal + Ice_"
    
description "Custom tags, chat colors, & name colors."
    
version PLUGIN_VERSION
    
url "https://forums.alliedmods.net/, http://steamcommunity.com/profiles/76561198117802354" 



public 
void OnPluginStart() 


        
gH_Cookie RegClientCookie("sm_chatcolors_cookie""Contains the used chat color"CookieAccess_Protected); 
        
gH_Cookie2 RegClientCookie("sm_chattag_cookie""Contains the used chat tag."CookieAccess_Protected); 
        
gH_Cookie3 RegClientCookie("sm_suffix_cookie""Contains the used chat suffix."CookieAccess_Protected); 
        
RegAdminCmd("sm_sufixo"Command_SuffixADMFLAG_GENERIC"Allows the player to change their ChatTag."); 
        
gH_Cookie4 RegClientCookie("sm_namecolor_cookie""Contains the used name color"CookieAccess_Protected); 
        
CreateConVar("sm_chatextender_version"PLUGIN_VERSION"Plugin version"FCVAR_DONTRECORD|FCVAR_NOTIFY); 
    
RegAdminCmd("sm_cores"Command_MenusADMFLAG_ROOT); 


public 
Action Command_Menus(int clientint args

    
Handle g_hMenuCS CreateMenu(MenuSelectHandler); 
    
SetMenuTitle(g_hMenuCS"Escolha o que quer colorir"); 
    
AddMenuItem(g_hMenuCS"ChatColors""Chat"); 
    
AddMenuItem(g_hMenuCS"NameColors""Nome"); 
    
SetMenuExitButton(g_hMenuCStrue); 
    
DisplayMenu(g_hMenuCSclient20); 


public 
MenuSelectHandler(Handle g_hMenuCSMenuAction maActionint clientint choice

    if (
maAction == MenuAction_Select
    { 
            
char sChoice[64];
            
GetMenuItem(g_hMenuCSchoicesChoicesizeof(sChoice));
            if(
StrEqual(sChoice"ChatColors")) 
            { 
                
Handle g_hMenuCC CreateMenu(MenuHandler_ColorsMENU_ACTIONS_ALL); 
                
SetMenuTitle(g_hMenuCC"Selecione a cor do chat:"); 
                
AddMenuItem(g_hMenuCC"none""Padrão"); 
                
AddMenuItem(g_hMenuCC"\x02""Vermelho"); 
                
AddMenuItem(g_hMenuCC"\x03""Cor do Time"); 
                
AddMenuItem(g_hMenuCC"\x04""Verde"); 
                
AddMenuItem(g_hMenuCC"\x05""Verde Claro"); 
                
AddMenuItem(g_hMenuCC"\x06""Limão"); 
                
AddMenuItem(g_hMenuCC"\x07""Vermelho Claro"); 
                
AddMenuItem(g_hMenuCC"\x08""Cinza"); 
                
AddMenuItem(g_hMenuCC"\x09""Oliva"); 
                
AddMenuItem(g_hMenuCC"\x0B""Azul Claro"); 
                
AddMenuItem(g_hMenuCC"\x0C""Azul"); 
                
AddMenuItem(g_hMenuCC"\x0C""Roxo"); 
                
AddMenuItem(g_hMenuCC"\x0E""Rosa"); 
                
AddMenuItem(g_hMenuCC"\x10""Dourado"); 
                
AddMenuItem(g_hMenuCC"\x0F""Laranja"); 
                
SetMenuExitButton(g_hMenuCCtrue); 
                
DisplayMenu(g_hMenuCCclient20); 
            } 
            if(
StrEqual(sChoice"NameColors")) 
            { 
                
Handle g_hMenuCN CreateMenu(MenuHandler_NameColorMENU_ACTIONS_ALL); 
                
SetMenuTitle(g_hMenuCN"Selecione a cor do nome:"); 
                
AddMenuItem(g_hMenuCN"none""Padrão"); 
                
AddMenuItem(g_hMenuCN"\x02""Vermelho"); 
                
AddMenuItem(g_hMenuCN"\x03""Cor do Time"); 
                
AddMenuItem(g_hMenuCN"\x04""Verde"); 
                
AddMenuItem(g_hMenuCN"\x05""Verde Claro"); 
                
AddMenuItem(g_hMenuCN"\x06""Limão"); 
                
AddMenuItem(g_hMenuCN"\x07""Vermelho Claro"); 
                
AddMenuItem(g_hMenuCN"\x08""Cinza"); 
                
AddMenuItem(g_hMenuCN"\x09""Oliva"); 
                
AddMenuItem(g_hMenuCN"\x0B""Azul Claro"); 
                
AddMenuItem(g_hMenuCN"\x0C""Azul"); 
                
AddMenuItem(g_hMenuCN"\x0C""Roxo"); 
                
AddMenuItem(g_hMenuCN"\x0E""Rosa"); 
                
AddMenuItem(g_hMenuCN"\x10""Dourado"); 
                
AddMenuItem(g_hMenuCN"\x0F""Laranja"); 
                
SetMenuExitButton(g_hMenuCNtrue); 
                
DisplayMenu(g_hMenuCNclient20); 
            } 
            else if(
maAction == MenuAction_End
            { 
                
CloseHandle(g_hMenuCS); 
            } 
    } 

public 
int MenuHandler_Colors(Handle g_hMenuCCMenuAction maActionint clientint choice

    if(
maAction == MenuAction_Select
    { 
        
char sChoice[8]; 
        
GetMenuItem(g_hMenuCCchoicesChoice8); 

        if(
StrEqual(sChoice"none")) 
        { 
            
FormatEx(sChoice8"\x01"); 
        } 

        if(
StrEqual(sChoice"\x03")) 
        { 
            
CPrintToChat(client" \x0C[hP Chat]\x01 A cor do seu chat combinará com a cor da sua equipe."); 
        } 

        else 
        { 
            
CPrintToChat(client" \x0C[hP Chat]\x01 Você selecionou %sesta cor\x01."sChoice); 
        } 
        
SetClientCookie(clientgH_CookiesChoice); 
    } 

    else if(
maAction == MenuAction_End
    { 
        
CloseHandle(g_hMenuCC); 
    } 


public 
int MenuHandler_NameColor(Handle g_hMenuCNMenuAction maActionint clientint choice

    if(
maAction == MenuAction_Select
    { 
        
char sChoice[8]; 
        
GetMenuItem(g_hMenuCNchoicesChoice8); 

        
SetClientCookie(clientgH_Cookie4sChoice); 

        if(
StrEqual(sChoice"none")) 
        { 
            
FormatEx(sChoice8"\x01"); 
        } 

        if(
StrEqual(sChoice"\x03")) 
        { 
            
CPrintToChat(client" \x0C[hP Chat]\x01 Sua cor do seu nome combinará com a cor da sua equipe."); 
        } 

        else 
        { 
            
CPrintToChat(client" \x0C[hP Chat]\x01 Você selecionou %sesta cor\x01."sChoice); 
        } 
    } 

    else if(
maAction == MenuAction_End
    { 
        
CloseHandle(g_hMenuCN); 
    } 


stock bool:IsValidClient(client) { 
    return (
client && client <= MaxClients); 

public 
Action Command_Tag(int clientint args

    if (
IsValidClient(client)) 
    { 
        if (
args 1
        { 
            
ReplyToCommand(client"\x0C[hP Chat]\x01 Uso: sm_tag <tag>."); 
            return 
Plugin_Handled
        } 

        
char arg[32]; 
        
GetCmdArg(1argsizeof(arg)); 

        
ReplaceString(argsizeof(arg), "{teamcolor}""\x03"false); 

        
SetClientCookie(clientgH_Cookie2arg); 

        if(
StrEqual(arg"none"false)) 
        { 
            
CPrintToChat(client" \x0B[hP Chat]\x01 Você removeu sua tag."); 
            return 
Plugin_Handled
        } 

        
CPrintToChat(client" \x0B[hP Chat]\x01 Você selecionou a tag: '%s\x01'."arg); 

        return 
Plugin_Handled
    } 
    return 
Plugin_Handled

public 
Action Command_Suffix(int clientint args

    if (
IsValidClient(client)) 
    { 
        if (
args 1
        { 
            
ReplyToCommand(client"\x0C[hP Chat]\x01 Uso: sm_sufixo <tag>."); 
            return 
Plugin_Handled
        } 

        
char arg[32]; 
        
GetCmdArg(1argsizeof(arg)); 

        
ReplaceString(argsizeof(arg), "{teamcolor}""\x03"false); 

        
SetClientCookie(clientgH_Cookie3arg); 

        if(
StrEqual(arg"none"false)) 
        { 
            
CPrintToChat(client" \x0B[hP Chat]\x01 Você removeu seu sufixo."); 
            return 
Plugin_Handled
        } 

        
CPrintToChat(client" \x0C[hP Chat]\x01 Você selecionou o sufixo: '%s\x01'."arg); 

        return 
Plugin_Handled
    } 
    return 
Plugin_Handled

public 
Action OnChatMessage(int &clientHandle hRecipientschar[] sNamechar[] sMessage

    if(
CheckCommandAccess(client"sm_cores"ADMFLAG_GENERIC)) 
    { 
        
char sCookie[8]; 
        
GetClientCookie(clientgH_CookiesCookiesizeof(sCookie)); 

        
char sCookie2[32]; 
        
GetClientCookie(clientgH_Cookie2sCookie2sizeof(sCookie2)); 

        
char sCookie3[32]; 
        
GetClientCookie(clientgH_Cookie3sCookie3sizeof(sCookie3)); 

        
char sCookie4[8]; 
        
GetClientCookie(clientgH_Cookie4sCookie4sizeof(sCookie4)); 

        if(
StrEqual(sCookie"") || StrEqual(sCookie"none")) 
        { 
            if(
StrEqual(sCookie2"") || StrEqual(sCookie2"none")) 
            { 
                if(
StrEqual(sCookie3"") || StrEqual(sCookie3"none")) 
                { 
                    if(
StrEqual(sCookie4"") || StrEqual(sCookie4"none")) 
                    { 
                        return 
Plugin_Continue
                    } 
                } 
            } 
        } 

        if(
StrEqual(sCookie2"") || StrEqual(sCookie2"none")) 
        { 
            
strcopy(sCookie2sizeof(sCookie2), ""); 
        } 

        if(
StrEqual(sCookie3"") || StrEqual(sCookie3"none")) 
        { 
            
strcopy(sCookie3sizeof(sCookie3), ""); 
        } 

        if(
StrEqual(sCookie4"") || StrEqual(sCookie4"none")) 
        { 
            
strcopy(sCookie4sizeof(sCookie3), "\x03"); 
        } 

        
Format(sMessageMAXLENGTH_INPUT"%s%s"sCookiesMessage); 
        
CFormat(sMessageMAXLENGTH_INPUT); 

        
Format(sNameMAXLENGTH_INPUT"%s%s%s%s"sCookie2sCookie4sNamesCookie3); 
        
CFormat(sNameMAXLENGTH_INPUT); 

        return 
Plugin_Changed
    } 

    return 
Plugin_Continue

Should fix your problem.
Added:
PHP Code:
char sChoice[64];
GetMenuItem(g_hMenuCSchoicesChoicesizeof(sChoice)); 
__________________
Contact Me:
Steam: NoyB
Discord: Noy#9999
Taking Private Requests
BraveFox is offline
Ice_MMB
Junior Member
Join Date: Jul 2017
Old 07-28-2017 , 18:09   Re: What am I doing wrong?
Reply With Quote #7

Quote:
Originally Posted by BraveFox View Post
PHP Code:
#include <sourcemod> 
#include <clientprefs> 
#include <scp> 
#include <colors_csgo> 

#pragma semicolon 1/ 
#pragma dynamic 131072 

#define PLUGIN_VERSION "1.0" 

Handle gH_Cookie INVALID_HANDLE
Handle gH_Cookie2 INVALID_HANDLE
Handle gH_Cookie3 INVALID_HANDLE
Handle gH_Cookie4 INVALID_HANDLE

public 
Plugin:myinfo 

    
name "hP Chat"
    
author "Shavit + AntiTeal + Ice_"
    
description "Custom tags, chat colors, & name colors."
    
version PLUGIN_VERSION
    
url "https://forums.alliedmods.net/, http://steamcommunity.com/profiles/76561198117802354" 



public 
void OnPluginStart() 


        
gH_Cookie RegClientCookie("sm_chatcolors_cookie""Contains the used chat color"CookieAccess_Protected); 
        
gH_Cookie2 RegClientCookie("sm_chattag_cookie""Contains the used chat tag."CookieAccess_Protected); 
        
gH_Cookie3 RegClientCookie("sm_suffix_cookie""Contains the used chat suffix."CookieAccess_Protected); 
        
RegAdminCmd("sm_sufixo"Command_SuffixADMFLAG_GENERIC"Allows the player to change their ChatTag."); 
        
gH_Cookie4 RegClientCookie("sm_namecolor_cookie""Contains the used name color"CookieAccess_Protected); 
        
CreateConVar("sm_chatextender_version"PLUGIN_VERSION"Plugin version"FCVAR_DONTRECORD|FCVAR_NOTIFY); 
    
RegAdminCmd("sm_cores"Command_MenusADMFLAG_ROOT); 


public 
Action Command_Menus(int clientint args

    
Handle g_hMenuCS CreateMenu(MenuSelectHandler); 
    
SetMenuTitle(g_hMenuCS"Escolha o que quer colorir"); 
    
AddMenuItem(g_hMenuCS"ChatColors""Chat"); 
    
AddMenuItem(g_hMenuCS"NameColors""Nome"); 
    
SetMenuExitButton(g_hMenuCStrue); 
    
DisplayMenu(g_hMenuCSclient20); 


public 
MenuSelectHandler(Handle g_hMenuCSMenuAction maActionint clientint choice

    if (
maAction == MenuAction_Select
    { 
            
char sChoice[64];
            
GetMenuItem(g_hMenuCSchoicesChoicesizeof(sChoice));
            if(
StrEqual(sChoice"ChatColors")) 
            { 
                
Handle g_hMenuCC CreateMenu(MenuHandler_ColorsMENU_ACTIONS_ALL); 
                
SetMenuTitle(g_hMenuCC"Selecione a cor do chat:"); 
                
AddMenuItem(g_hMenuCC"none""Padrão"); 
                
AddMenuItem(g_hMenuCC"\x02""Vermelho"); 
                
AddMenuItem(g_hMenuCC"\x03""Cor do Time"); 
                
AddMenuItem(g_hMenuCC"\x04""Verde"); 
                
AddMenuItem(g_hMenuCC"\x05""Verde Claro"); 
                
AddMenuItem(g_hMenuCC"\x06""Limão"); 
                
AddMenuItem(g_hMenuCC"\x07""Vermelho Claro"); 
                
AddMenuItem(g_hMenuCC"\x08""Cinza"); 
                
AddMenuItem(g_hMenuCC"\x09""Oliva"); 
                
AddMenuItem(g_hMenuCC"\x0B""Azul Claro"); 
                
AddMenuItem(g_hMenuCC"\x0C""Azul"); 
                
AddMenuItem(g_hMenuCC"\x0C""Roxo"); 
                
AddMenuItem(g_hMenuCC"\x0E""Rosa"); 
                
AddMenuItem(g_hMenuCC"\x10""Dourado"); 
                
AddMenuItem(g_hMenuCC"\x0F""Laranja"); 
                
SetMenuExitButton(g_hMenuCCtrue); 
                
DisplayMenu(g_hMenuCCclient20); 
            } 
            if(
StrEqual(sChoice"NameColors")) 
            { 
                
Handle g_hMenuCN CreateMenu(MenuHandler_NameColorMENU_ACTIONS_ALL); 
                
SetMenuTitle(g_hMenuCN"Selecione a cor do nome:"); 
                
AddMenuItem(g_hMenuCN"none""Padrão"); 
                
AddMenuItem(g_hMenuCN"\x02""Vermelho"); 
                
AddMenuItem(g_hMenuCN"\x03""Cor do Time"); 
                
AddMenuItem(g_hMenuCN"\x04""Verde"); 
                
AddMenuItem(g_hMenuCN"\x05""Verde Claro"); 
                
AddMenuItem(g_hMenuCN"\x06""Limão"); 
                
AddMenuItem(g_hMenuCN"\x07""Vermelho Claro"); 
                
AddMenuItem(g_hMenuCN"\x08""Cinza"); 
                
AddMenuItem(g_hMenuCN"\x09""Oliva"); 
                
AddMenuItem(g_hMenuCN"\x0B""Azul Claro"); 
                
AddMenuItem(g_hMenuCN"\x0C""Azul"); 
                
AddMenuItem(g_hMenuCN"\x0C""Roxo"); 
                
AddMenuItem(g_hMenuCN"\x0E""Rosa"); 
                
AddMenuItem(g_hMenuCN"\x10""Dourado"); 
                
AddMenuItem(g_hMenuCN"\x0F""Laranja"); 
                
SetMenuExitButton(g_hMenuCNtrue); 
                
DisplayMenu(g_hMenuCNclient20); 
            } 
            else if(
maAction == MenuAction_End
            { 
                
CloseHandle(g_hMenuCS); 
            } 
    } 

public 
int MenuHandler_Colors(Handle g_hMenuCCMenuAction maActionint clientint choice

    if(
maAction == MenuAction_Select
    { 
        
char sChoice[8]; 
        
GetMenuItem(g_hMenuCCchoicesChoice8); 

        if(
StrEqual(sChoice"none")) 
        { 
            
FormatEx(sChoice8"\x01"); 
        } 

        if(
StrEqual(sChoice"\x03")) 
        { 
            
CPrintToChat(client" \x0C[hP Chat]\x01 A cor do seu chat combinará com a cor da sua equipe."); 
        } 

        else 
        { 
            
CPrintToChat(client" \x0C[hP Chat]\x01 Você selecionou %sesta cor\x01."sChoice); 
        } 
        
SetClientCookie(clientgH_CookiesChoice); 
    } 

    else if(
maAction == MenuAction_End
    { 
        
CloseHandle(g_hMenuCC); 
    } 


public 
int MenuHandler_NameColor(Handle g_hMenuCNMenuAction maActionint clientint choice

    if(
maAction == MenuAction_Select
    { 
        
char sChoice[8]; 
        
GetMenuItem(g_hMenuCNchoicesChoice8); 

        
SetClientCookie(clientgH_Cookie4sChoice); 

        if(
StrEqual(sChoice"none")) 
        { 
            
FormatEx(sChoice8"\x01"); 
        } 

        if(
StrEqual(sChoice"\x03")) 
        { 
            
CPrintToChat(client" \x0C[hP Chat]\x01 Sua cor do seu nome combinará com a cor da sua equipe."); 
        } 

        else 
        { 
            
CPrintToChat(client" \x0C[hP Chat]\x01 Você selecionou %sesta cor\x01."sChoice); 
        } 
    } 

    else if(
maAction == MenuAction_End
    { 
        
CloseHandle(g_hMenuCN); 
    } 


stock bool:IsValidClient(client) { 
    return (
client && client <= MaxClients); 

public 
Action Command_Tag(int clientint args

    if (
IsValidClient(client)) 
    { 
        if (
args 1
        { 
            
ReplyToCommand(client"\x0C[hP Chat]\x01 Uso: sm_tag <tag>."); 
            return 
Plugin_Handled
        } 

        
char arg[32]; 
        
GetCmdArg(1argsizeof(arg)); 

        
ReplaceString(argsizeof(arg), "{teamcolor}""\x03"false); 

        
SetClientCookie(clientgH_Cookie2arg); 

        if(
StrEqual(arg"none"false)) 
        { 
            
CPrintToChat(client" \x0B[hP Chat]\x01 Você removeu sua tag."); 
            return 
Plugin_Handled
        } 

        
CPrintToChat(client" \x0B[hP Chat]\x01 Você selecionou a tag: '%s\x01'."arg); 

        return 
Plugin_Handled
    } 
    return 
Plugin_Handled

public 
Action Command_Suffix(int clientint args

    if (
IsValidClient(client)) 
    { 
        if (
args 1
        { 
            
ReplyToCommand(client"\x0C[hP Chat]\x01 Uso: sm_sufixo <tag>."); 
            return 
Plugin_Handled
        } 

        
char arg[32]; 
        
GetCmdArg(1argsizeof(arg)); 

        
ReplaceString(argsizeof(arg), "{teamcolor}""\x03"false); 

        
SetClientCookie(clientgH_Cookie3arg); 

        if(
StrEqual(arg"none"false)) 
        { 
            
CPrintToChat(client" \x0B[hP Chat]\x01 Você removeu seu sufixo."); 
            return 
Plugin_Handled
        } 

        
CPrintToChat(client" \x0C[hP Chat]\x01 Você selecionou o sufixo: '%s\x01'."arg); 

        return 
Plugin_Handled
    } 
    return 
Plugin_Handled

public 
Action OnChatMessage(int &clientHandle hRecipientschar[] sNamechar[] sMessage

    if(
CheckCommandAccess(client"sm_cores"ADMFLAG_GENERIC)) 
    { 
        
char sCookie[8]; 
        
GetClientCookie(clientgH_CookiesCookiesizeof(sCookie)); 

        
char sCookie2[32]; 
        
GetClientCookie(clientgH_Cookie2sCookie2sizeof(sCookie2)); 

        
char sCookie3[32]; 
        
GetClientCookie(clientgH_Cookie3sCookie3sizeof(sCookie3)); 

        
char sCookie4[8]; 
        
GetClientCookie(clientgH_Cookie4sCookie4sizeof(sCookie4)); 

        if(
StrEqual(sCookie"") || StrEqual(sCookie"none")) 
        { 
            if(
StrEqual(sCookie2"") || StrEqual(sCookie2"none")) 
            { 
                if(
StrEqual(sCookie3"") || StrEqual(sCookie3"none")) 
                { 
                    if(
StrEqual(sCookie4"") || StrEqual(sCookie4"none")) 
                    { 
                        return 
Plugin_Continue
                    } 
                } 
            } 
        } 

        if(
StrEqual(sCookie2"") || StrEqual(sCookie2"none")) 
        { 
            
strcopy(sCookie2sizeof(sCookie2), ""); 
        } 

        if(
StrEqual(sCookie3"") || StrEqual(sCookie3"none")) 
        { 
            
strcopy(sCookie3sizeof(sCookie3), ""); 
        } 

        if(
StrEqual(sCookie4"") || StrEqual(sCookie4"none")) 
        { 
            
strcopy(sCookie4sizeof(sCookie3), "\x03"); 
        } 

        
Format(sMessageMAXLENGTH_INPUT"%s%s"sCookiesMessage); 
        
CFormat(sMessageMAXLENGTH_INPUT); 

        
Format(sNameMAXLENGTH_INPUT"%s%s%s%s"sCookie2sCookie4sNamesCookie3); 
        
CFormat(sNameMAXLENGTH_INPUT); 

        return 
Plugin_Changed
    } 

    return 
Plugin_Continue

Should fix your problem.
Added:
PHP Code:
char sChoice[64];
GetMenuItem(g_hMenuCSchoicesChoicesizeof(sChoice)); 
Fixed
PHP Code:
#include <sourcemod>
#include <clientprefs>
#include <scp>
#include <colors_csgo>

#pragma semicolon 1
#pragma dynamic 131072

#define PLUGIN_VERSION "1.0"

Handle gH_Cookie INVALID_HANDLE;
Handle gH_Cookie2 INVALID_HANDLE;
Handle gH_Cookie3 INVALID_HANDLE;
Handle gH_Cookie4 INVALID_HANDLE;

public 
Plugin:myinfo =
{
    
name "hP Chat",
    
author "Shavit + AntiTeal + Ice_",
    
description "Custom tags, chat colors, & name colors.",
    
version PLUGIN_VERSION,
    
url "https://forums.alliedmods.net/, http://steamcommunity.com/profiles/76561198117802354"
}


public 
void OnPluginStart()
{

        
gH_Cookie RegClientCookie("sm_chatcolors_cookie""Contains the used chat color"CookieAccess_Protected);
        
gH_Cookie2 RegClientCookie("sm_chattag_cookie""Contains the used chat tag."CookieAccess_Protected);
        
RegAdminCmd("sm_prefixo"Command_TagADMFLAG_GENERIC"Allows the player to change their ChatTag.");
        
gH_Cookie3 RegClientCookie("sm_suffix_cookie""Contains the used chat suffix."CookieAccess_Protected);
        
RegAdminCmd("sm_sufixo"Command_SuffixADMFLAG_GENERIC"Allows the player to change their ChatTag.");
        
gH_Cookie4 RegClientCookie("sm_namecolor_cookie""Contains the used name color"CookieAccess_Protected);
        
CreateConVar("sm_chatextender_version"PLUGIN_VERSION"Plugin version"FCVAR_DONTRECORD|FCVAR_NOTIFY);
        
RegAdminCmd("sm_cores"Command_MenusADMFLAG_GENERIC"Open menu");
}

public 
Action Command_Menus(int clientint args)
{
    
Handle g_hMenuCS CreateMenu(MenuSelectHandler);
    
SetMenuTitle(g_hMenuCS"Escolha o que quer colorir");
    
AddMenuItem(g_hMenuCS"ChatColors""Chat");
    
AddMenuItem(g_hMenuCS"NameColors""Nome");
    
SetMenuExitButton(g_hMenuCStrue);
    
DisplayMenu(g_hMenuCSclient20);
}

public 
MenuSelectHandler(Handle g_hMenuCSMenuAction maActionint clientint choice)
{
    if (
maAction == MenuAction_Select)
    {
            
char sChoice[64];
            
GetMenuItem(g_hMenuCSchoicesChoicesizeof(sChoice));

            if(
StrEqual(sChoice"ChatColors"))
            {
                 
Handle g_hMenuCC CreateMenu(MenuHandler_ColorsMENU_ACTIONS_ALL);
                
SetMenuTitle(g_hMenuCC"Selecione a cor do chat:");
                
AddMenuItem(g_hMenuCC"none""Padrão");
                
AddMenuItem(g_hMenuCC"\x02""Vermelho");
                
AddMenuItem(g_hMenuCC"\x03""Cor do Time");
                
AddMenuItem(g_hMenuCC"\x04""Verde");
                
AddMenuItem(g_hMenuCC"\x05""Verde Claro");
                
AddMenuItem(g_hMenuCC"\x06""Limão");
                
AddMenuItem(g_hMenuCC"\x07""Vermelho Claro");
                
AddMenuItem(g_hMenuCC"\x08""Cinza");
                
AddMenuItem(g_hMenuCC"\x09""Oliva");
                
AddMenuItem(g_hMenuCC"\x0B""Azul Claro");
                
AddMenuItem(g_hMenuCC"\x0C""Azul");
                
AddMenuItem(g_hMenuCC"\x0C""Roxo");
                
AddMenuItem(g_hMenuCC"\x0E""Rosa");
                
AddMenuItem(g_hMenuCC"\x10""Dourado");
                
AddMenuItem(g_hMenuCC"\x0F""Laranja");
                
SetMenuExitButton(g_hMenuCCtrue);
                
DisplayMenu(g_hMenuCCclient20);
            }
            if(
StrEqual(sChoice"NameColors"))
            {
                
Handle g_hMenuCN CreateMenu(MenuHandler_NameColorMENU_ACTIONS_ALL);
                
SetMenuTitle(g_hMenuCN"Selecione a cor do nome:");
                
AddMenuItem(g_hMenuCN"none""Padrão");
                
AddMenuItem(g_hMenuCN"\x02""Vermelho");
                
AddMenuItem(g_hMenuCN"\x03""Cor do Time");
                
AddMenuItem(g_hMenuCN"\x04""Verde");
                
AddMenuItem(g_hMenuCN"\x05""Verde Claro");
                
AddMenuItem(g_hMenuCN"\x06""Limão");
                
AddMenuItem(g_hMenuCN"\x07""Vermelho Claro");
                
AddMenuItem(g_hMenuCN"\x08""Cinza");
                
AddMenuItem(g_hMenuCN"\x09""Oliva");
                
AddMenuItem(g_hMenuCN"\x0B""Azul Claro");
                
AddMenuItem(g_hMenuCN"\x0C""Azul");
                
AddMenuItem(g_hMenuCN"\x0C""Roxo");
                
AddMenuItem(g_hMenuCN"\x0E""Rosa");
                
AddMenuItem(g_hMenuCN"\x10""Dourado");
                
AddMenuItem(g_hMenuCN"\x0F""Laranja");
                
SetMenuExitButton(g_hMenuCNtrue);
                
DisplayMenu(g_hMenuCNclient20);
            }
            else if(
maAction == MenuAction_End)
            {
                
CloseHandle(g_hMenuCS);
            }
    }
}
public 
int MenuHandler_Colors(Handle g_hMenuCCMenuAction maActionint clientint choice)
{
    if(
maAction == MenuAction_Select)
    {
        
char sChoice[8];
        
GetMenuItem(g_hMenuCCchoicesChoice8);

        if(
StrEqual(sChoice"none"))
        {
            
FormatEx(sChoice8"\x01");
        }

        if(
StrEqual(sChoice"\x03"))
        {
            
CPrintToChat(client" \x0C[hP Chat]\x01 A cor do seu chat combinará com a cor da sua equipe.");
        }

        else
        {
            
CPrintToChat(client" \x0C[hP Chat]\x01 Você selecionou %sesta cor\x01."sChoice);
        }
        
SetClientCookie(clientgH_CookiesChoice);
    }

    else if(
maAction == MenuAction_End)
    {
        
CloseHandle(g_hMenuCC);
    }
}

public 
int MenuHandler_NameColor(Handle g_hMenuCNMenuAction maActionint clientint choice)
{
    if(
maAction == MenuAction_Select)
    {
        
char sChoice[8];
        
GetMenuItem(g_hMenuCNchoicesChoice8);

        
SetClientCookie(clientgH_Cookie4sChoice);

        if(
StrEqual(sChoice"none"))
        {
            
FormatEx(sChoice8"\x01");
        }

        if(
StrEqual(sChoice"\x03"))
        {
            
CPrintToChat(client" \x0C[hP Chat]\x01 Sua cor do seu nome combinará com a cor da sua equipe.");
        }

        else
        {
            
CPrintToChat(client" \x0C[hP Chat]\x01 Você selecionou %sesta cor\x01."sChoice);
        }
    }

    else if(
maAction == MenuAction_End)
    {
        
CloseHandle(g_hMenuCN);
    }
}

stock bool:IsValidClient(client) {
    return (
client && client <= MaxClients);
}
public 
Action Command_Tag(int clientint args)
{
    if (
IsValidClient(client))
    {
        if (
args 1)
        {
            
ReplyToCommand(client"\x0C[hP Chat]\x01 Uso: sm_tag <tag>.");
            return 
Plugin_Handled;
        }

        
char arg[32];
        
GetCmdArg(1argsizeof(arg));

        
ReplaceString(argsizeof(arg), "{teamcolor}""\x03"false);

        
SetClientCookie(clientgH_Cookie2arg);

        if(
StrEqual(arg"none"false))
        {
            
CPrintToChat(client" \x0B[hP Chat]\x01 Você removeu sua tag.");
            return 
Plugin_Handled;
        }

        
CPrintToChat(client" \x0B[hP Chat]\x01 Você selecionou a tag: '%s\x01'."arg);

        return 
Plugin_Handled;
    }
    return 
Plugin_Handled;
}
public 
Action Command_Suffix(int clientint args)
{
    if (
IsValidClient(client))
    {
        if (
args 1)
        {
            
ReplyToCommand(client"\x0C[hP Chat]\x01 Uso: sm_sufixo <tag>.");
            return 
Plugin_Handled;
        }

        
char arg[32];
        
GetCmdArg(1argsizeof(arg));

        
ReplaceString(argsizeof(arg), "{teamcolor}""\x03"false);

        
SetClientCookie(clientgH_Cookie3arg);

        if(
StrEqual(arg"none"false))
        {
            
CPrintToChat(client" \x0B[hP Chat]\x01 Você removeu seu sufixo.");
            return 
Plugin_Handled;
        }

        
CPrintToChat(client" \x0C[hP Chat]\x01 Você selecionou o sufixo: '%s\x01'."arg);

        return 
Plugin_Handled;
    }
    return 
Plugin_Handled;
}
public 
Action OnChatMessage(int &clientHandle hRecipientschar[] sNamechar[] sMessage)
{
    if(
CheckCommandAccess(client"sm_cores"ADMFLAG_GENERIC))
    {
        
char sCookie[8];
        
GetClientCookie(clientgH_CookiesCookiesizeof(sCookie));

        
char sCookie2[32];
        
GetClientCookie(clientgH_Cookie2sCookie2sizeof(sCookie2));

        
char sCookie3[32];
        
GetClientCookie(clientgH_Cookie3sCookie3sizeof(sCookie3));

        
char sCookie4[8];
        
GetClientCookie(clientgH_Cookie4sCookie4sizeof(sCookie4));

        if(
StrEqual(sCookie"") || StrEqual(sCookie"none"))
        {
            if(
StrEqual(sCookie2"") || StrEqual(sCookie2"none"))
            {
                if(
StrEqual(sCookie3"") || StrEqual(sCookie3"none"))
                {
                    if(
StrEqual(sCookie4"") || StrEqual(sCookie4"none"))
                    {
                        return 
Plugin_Continue;
                    }
                }
            }
        }

        if(
StrEqual(sCookie2"") || StrEqual(sCookie2"none"))
        {
            
strcopy(sCookie2sizeof(sCookie2), "");
        }

        if(
StrEqual(sCookie3"") || StrEqual(sCookie3"none"))
        {
            
strcopy(sCookie3sizeof(sCookie3), "");
        }

        if(
StrEqual(sCookie4"") || StrEqual(sCookie4"none"))
        {
            
strcopy(sCookie4sizeof(sCookie3), "\x03");
        }

        
Format(sMessageMAXLENGTH_INPUT"%s%s"sCookiesMessage);
        
CFormat(sMessageMAXLENGTH_INPUT);

        
Format(sNameMAXLENGTH_INPUT"%s%s%s%s"sCookie2sCookie4sNamesCookie3);
        
CFormat(sNameMAXLENGTH_INPUT);

        return 
Plugin_Changed;
    }

    return 
Plugin_Continue;


Last edited by Ice_MMB; 07-28-2017 at 19:09.
Ice_MMB is offline
vortex.
AlliedModders Donor
Join Date: Jan 2017
Location: OnGameFrame()
Old 07-28-2017 , 18:34   Re: What am I doing wrong?
Reply With Quote #8

Congrats
__________________
vortex. is offline
Ice_MMB
Junior Member
Join Date: Jul 2017
Old 07-28-2017 , 19:28   Re: What am I doing wrong?
Reply With Quote #9

Quote:
Originally Posted by vortex. View Post
Congrats
Thanks
Ice_MMB is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:47.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode