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

[CS:GO] undefined symbol error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
einsfuhrer
Member
Join Date: Jun 2019
Old 07-08-2019 , 14:14   [CS:GO] undefined symbol error
Reply With Quote #1

Hay, I'm struggling with a error on my plugin. I'm trying to set the chattag and chatcolor when you type a command and I'm making a public Action but I get the error:

"(36) : error 017: undefined symbol 'Command_hidetag'"

And my code is:

PHP Code:
public void OnPluginStart()
{
    
/* Similar chunk from Kyles clientprefs tutorial. */
    
g_hCookie RegClientCookie("OurTestCookie""A Test Cookie for use in our Tutorial"CookieAccess_Private);
    
SetCookiePrefabMenu(g_hCookieCookieMenu_OnOff_Int"");
    
    
g_cSbTime CreateConVar("Chat-Timestamps_Scoreboard""1""Sets whether the scoreboard time is enabled or disabled");
    
    
//RegAdminCmd("sm_cts", Cmd_ChatTimeStamps, ADMFLAG_ROOT);
    
RegAdminCmd("sm_hiderole"Command_hidetagADMFLAG_KICK"Desc""Group");
    
    for (
int i 1<= MaxClientsi++)
    {
        if (!
AreClientCookiesCached(i))
            continue;
        
        
OnClientCookiesCached(i);
    }
    
    
AutoExecConfig();

PHP Code:
public Action Command_hiderole(int clientint args)
{
        if (
IsClientInGame(iClient))
            {
                if(
IsPlayerAlive(iClient)) 
                {   
                    if (
CheckCommandAccess(iClient"chattag"ADMFLAG_ROOT))
                    {
                        if (
GetClientTeam(iClient) == 3)
                            
PrintToChatAll(" \x0AHIDEROLE \x01| \x0B%N \x08» \x01%s"iClientsArgs);
                                
                        if (
GetClientTeam(iClient) == 2)
                            
PrintToChatAll(" \x0AHIDEROLE \x01| \x09%N \x08» \x01%s"iClientsArgs);

                        else if (
GetClientTeam(iClient) == 1)
                            
PrintToChatAll(" \x0AHIDEROLE \x01| \x03%N \x08» \x01%s"iClientsArgs);
                    }
                }
                else
                {
                    if (
CheckCommandAccess(iClient"chattag"ADMFLAG_ROOT))
                {
                    if (
GetClientTeam(iClient) == 3)
                        
PrintToChatAll(" \x0FDEAD \x01| \x0AOWNER \x01| \x0B%N \x08» \x01%s"iClientsArgs);
                            
                    if (
GetClientTeam(iClient) == 2)
                        
PrintToChatAll(" \x0FDEAD \x01|  \x0AOWNER \x01| \x09%N \x08» \x01%s"iClientsArgs);

                    else if (
GetClientTeam(iClient) == 1)
                        
PrintToChatAll(" \x0FDEAD \x01|  \x0AOWNER \x01| \x03%N \x08» \x01%s"iClientsArgs);
                }
                else
                {
                    if (
GetClientTeam(iClient) == 3)
                        
PrintToChatAll(" \x0FDEAD \x01|  \x08\x01\x0B%N \x08» \x01%s"iClientsArgs);
                            
                    if (
GetClientTeam(iClient) == 2)
                        
PrintToChatAll(" \x0FDEAD \x01|  \x08\x01\x09%N \x08» \x01%s"iClientsArgs);

                    else if (
GetClientTeam(iClient) == 1)
                        
PrintToChatAll(" \x0FDEAD \x01|  \x08\x01\x03%N \x08» \x01%s"iClientsArgs);
                }
                }
            }
 
    return 
Plugin_Handled;

What am I doing wrong?
einsfuhrer is offline
CrazyHackGUT
AlliedModders Donor
Join Date: Feb 2016
Location: Izhevsk, Russia
Old 07-08-2019 , 14:26   Re: [CS:GO] undefined symbol error
Reply With Quote #2

You named your callback wrong.
__________________
My english is very bad. I am live in Russia. Learning english language - very hard task for me...
CrazyHackGUT is offline
Send a message via ICQ to CrazyHackGUT Send a message via Skype™ to CrazyHackGUT
einsfuhrer
Member
Join Date: Jun 2019
Old 07-08-2019 , 15:47   Re: [CS:GO] undefined symbol error
Reply With Quote #3

Quote:
Originally Posted by CrazyHackGUT View Post
You named your callback wrong.
So I changed the callback to the correct one but it still gives me the same error. Is there another problem in the code?
einsfuhrer is offline
Cruze
Veteran Member
Join Date: May 2017
Old 07-09-2019 , 04:50   Re: [CS:GO] undefined symbol error
Reply With Quote #4

You have given 2 else condition On IsPlayerAlive
__________________
Taking paid private requests! Contact me
Cruze is offline
I am inevitable
Member
Join Date: May 2019
Location: 0xA6DA34
Old 07-09-2019 , 08:31   Re: [CS:GO] undefined symbol error
Reply With Quote #5

What you're saying right now is: if someone times sm_hiderole, then print a message in the chat, using an argument string that doesn't exist.

@Cruze
Yeah, that's not the issue.

You could make it even better. Btw, check out https://developer.mozilla.org/en-US/...ional_Operator

statement ? true : false

PrintToChatAll("%s", GetClientTeam(iClient) == 3 ? "hey" : "ho"); // in case this is false it'll just return 2

PHP Code:
public void OnClientSayCommand(int iClient, const char[] sCommand, const char[] sArgs)
{
    
// Validate client.
    
if (IsValidClient(iClient))
    {
        
int iTeam GetClientTeam(iClient);
        
        
// If the client isn't in spec.
        
if (iTeam 1)
        {
            if (
CheckCommandAccess(iClient""ADMFLAG_ROOT))
            {
                
PrintToChatAll(" %s %s%N \x01: %s", !IsPlayerAlive(iClient) ? "\x0FDEAD" NULL_STRINGiTeam == "\x0B" "\x09"sArgs);
                
                
// Here's for printing messages to team only:
                
for (int i 1<= MaxClientsi++)
                {
                    if (
IsValidClient(i) && iTeam == GetClientTeam(i))
                    {
                        
PrintToChat(i, do this yourself);
                    }
                }
            }
        }
    }
}

bool IsValidClient(int iClient)
{
    return (
iClient <= MaxClients && IsClientInGame(iClient) && !IsFakeClient(iClient))

__________________
I do make plugins upon requests, so hit me up on discord if you're interested: Stefan Milivojevic#5311

Last edited by I am inevitable; 07-09-2019 at 11:33.
I am inevitable is offline
Govert
New Member
Join Date: Jul 2019
Old 07-09-2019 , 08:54   Re: [CS:GO] undefined symbol error
Reply With Quote #6

Quote:
Originally Posted by Cruze View Post
You have given 2 else condition On IsPlayerAlive
This can be the case. Did you fix it?
Govert is offline
I am inevitable
Member
Join Date: May 2019
Location: 0xA6DA34
Old 07-09-2019 , 11:31   Re: [CS:GO] undefined symbol error
Reply With Quote #7

Quote:
Originally Posted by Govert View Post
This can be the case. Did you fix it?
No that's not the issue. Count the brackets, the else statement is inside the other.
__________________
I do make plugins upon requests, so hit me up on discord if you're interested: Stefan Milivojevic#5311
I am inevitable is offline
Reply



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 02:10.


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