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

How to solve this "undefined symbol" error?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GlobalPlague
Senior Member
Join Date: Feb 2016
Location: Pluto
Old 01-22-2023 , 12:35   How to solve this "undefined symbol" error?
Reply With Quote #1

Hello, i get these errors:

Code:
//AMXXPC compile.exe
// by the AMX Mod X Dev Team

zp43_gas_mask.sma(45) : error 017: undefined symbol "set_ent_rendering"
zp43_gas_mask.sma(67) : error 017: undefined symbol "set_ent_rendering"
zp43_gas_mask.sma(80) : error 017: undefined symbol "set_ent_rendering"
zp43_gas_mask.sma(86) : error 017: undefined symbol "set_ent_rendering"
zp43_gas_mask.sma(92) : error 017: undefined symbol "set_ent_rendering"
zp43_gas_mask.sma(97) : error 017: undefined symbol "set_ent_rendering"


Here is the code:

Code:
#include <amxmodx>
#include <hamsandwich>
#include <engine>
#include <zombie_plague_advance>
	
#define _MarkPlayerHasMask(%0)   _bitPlayerHasMask |= (1 << (%0 & 31))
#define _ClearPlayerWithMask(%0)  _bitPlayerHasMask &= ~(1 << (%0 & 31))
#define _PlayerHasMask(%0)       _bitPlayerHasMask & (1 << (%0 & 31))
	
#define _PLUGIN   "[ZP43] Extra item: Gas Mask"
#define _VERSION             "3.0"
#define _AUTHOR           "H.RED.ZONE"

#define EV_INT_nadetype     EV_INT_flTimeStepSound
#define NADETYPE_INFECTION  1111 

new _ItemID

new _bitPlayerHasMask

new _gMaxPlayers, _gIcon, _gMsgSayText

public plugin_init() {
	register_plugin( _PLUGIN, _VERSION, _AUTHOR )
	
	RegisterHam( Ham_Spawn, "player", "_FW_PlayerSpawn", 1 )
	RegisterHam( Ham_Killed, "player", "_FW_PlayerKilled" )
		
	_ItemID = zp_register_extra_item( "Anti-Virus Mask \y(\rSingle-Use\y)", 200, ZP_TEAM_HUMAN )
	
	_gMaxPlayers = get_maxplayers( )
	_gIcon = get_user_msgid( "StatusIcon" ) 
	_gMsgSayText = get_user_msgid( "SayText" )
}

public plugin_precache() {
	RegisterHam( Ham_Think, "grenade", "_FW_ThinkGrenade", 1 ) 
}

public zp_extra_item_selected( plr, itemid ) {
        
	if( itemid == _ItemID ) {
		_MarkPlayerHasMask( plr )
		Icon_On( plr )
		set_ent_rendering(plr, kRenderFxGlowShell, 0, 150, 50, kRenderNormal, 3);
		ProtoChat(plr, "You now have Anti-Virus Mask. It will neutralize the effect of 1 infection grenade!")
	}
}

public _FW_ThinkGrenade( iEnt ) {
	
	if( is_valid_ent(iEnt) ) {
		
		if( entity_get_int(iEnt, EV_INT_nadetype) == NADETYPE_INFECTION ) {
			
			for( new plr = 1; plr <= _gMaxPlayers; plr++ ) {
				
				if( is_user_alive(plr) 
				
				&& _PlayerHasMask(plr) ) {
					
					if( get_entity_distance(iEnt, plr) <= 240 ) {
						
						_ClearPlayerWithMask( plr )
						remove_entity( iEnt )
						Icon_Off( plr )
						set_ent_rendering(plr);
						
						ProtoChat( plr, "Infection prevented! Your Anti-Virus mask can no longer be used." )
					}
				}
			}
		}
	}
}

public zp_user_infected_post( plr ) {
	_ClearPlayerWithMask( plr ) 
	Icon_Off( plr )
	set_ent_rendering(plr);
}

public _FW_PlayerSpawn( plr ) {
	_ClearPlayerWithMask( plr ) 
	Icon_Off( plr )
	set_ent_rendering(plr);
}

public _FW_PlayerKilled( plr ) {
	_ClearPlayerWithMask( plr ) 
	Icon_Off( plr )
	set_ent_rendering(plr);
}

public client_disconnect( plr ) {
	Icon_Off( plr )
	set_ent_rendering(plr);
}

public Icon_On( plr ) {
	message_begin( MSG_ONE_UNRELIABLE, _gIcon, { 0, 0, 0 }, plr );
	write_byte( 1 )
	write_string( "dmg_gas" )
	write_byte( 0 )
	write_byte( 255 )
	write_byte( 0 )
	message_end( )
}

public Icon_Off( plr ) {
	message_begin( MSG_ONE_UNRELIABLE, _gIcon, { 0, 0, 0 }, plr )
	write_byte( 0 )
	write_string( "dmg_gas" )
	write_byte( 0 )
	write_byte( 255 )
	write_byte( 0 )
	message_end( )
}

ProtoChat( plr, const sFormat[], any:... ) {
	
	static i; i = plr ? plr : get_player( )
	
	if ( !i ) {
		return PLUGIN_HANDLED;
	}
	
	new sMessage[ 256 ]
	new len = formatex( sMessage, 255, "^x01[^x04HELL-HOLE^x01] ")
	
	vformat( sMessage[len], 255-len, sFormat, 3 )
	sMessage[ 192 ] = '^0' 
	
	Make_SayText( plr, i, sMessage )
	
	return PLUGIN_CONTINUE
}

get_player( ) {
	for ( new plr; plr <= _gMaxPlayers; plr++ ) {
		if ( is_user_connected(plr) ) {
			return plr
		}
	}
	return PLUGIN_HANDLED
}

Make_SayText( Receiver, Sender, sMessage[] ) {
	if ( !Sender ) {
		return PLUGIN_HANDLED;
	}
	
	message_begin( Receiver ? MSG_ONE_UNRELIABLE : MSG_ALL, _gMsgSayText, {0,0,0}, Receiver )
	write_byte( Sender )
	write_string( sMessage )
	message_end( )
	
	return PLUGIN_CONTINUE;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang2057\\ f0\\ fs16 \n\\ par }
*/
The added codes are marked in red color, so it can be easy for you to spot them.

This is added:

Code:
set_ent_rendering(plr, kRenderFxGlowShell, 0, 150, 50, kRenderNormal, 3);
And this is added on multiple places:

Code:
set_ent_rendering(plr);
So, how can those errors be fixed? What causes them? I would like someone to explain this to me, so i can know how to fix them not only in this plugin, but in other plugins, too, if i get those errors.

Thanks.

Last edited by GlobalPlague; 01-22-2023 at 12:39.
GlobalPlague is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-22-2023 , 14:08   Re: How to solve this "undefined symbol" error?
Reply With Quote #2

set_ent_rendering() is an AMX Mod X built-in function and is defined when you include engine.inc. You likely need to fix your setup. If you're not 1.9.0 or newer, you need to upgrade, it does not exist in 1.8.2.
__________________
fysiks is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 01-24-2023 , 12:40   Re: How to solve this "undefined symbol" error?
Reply With Quote #3

Upgrading Amxx is REQUIRED, as previously stated. Script was never intended for the passe Amxx 182. Through perseverance, glow is possible.
Code:
#if !defined set_ent_rendering #define set_ent_rendering set_rendering #endif
__________________

Last edited by DJEarthQuake; 01-26-2023 at 14:48. Reason: blah blah blah
DJEarthQuake is offline
GlobalPlague
Senior Member
Join Date: Feb 2016
Location: Pluto
Old 01-25-2023 , 12:51   Re: How to solve this "undefined symbol" error?
Reply With Quote #4

Quote:
Originally Posted by fysiks View Post
set_ent_rendering() is an AMX Mod X built-in function and is defined when you include engine.inc. You likely need to fix your setup. If you're not 1.9.0 or newer, you need to upgrade, it does not exist in 1.8.2.
Yes, i still use AMXX 1.8.2. When i upgrade to 1.9, many plugins start showing many errors in the console. This is because my ZM mod uses plugins made during the AMXX 1.8.2 era and may not be compatible with newer versions of AMXX.

Quote:
Originally Posted by DJEarthQuake View Post
Upgrading Amxx is REQUIRED, as previously stated. Script was never intended for the passe Amxx 182. Through perseverance, glow is possible.

Method # 1: Define. (Just made this now.)
Code:
#if !defined set_ent_rendering #define set_ent_rendering set_rendering #endif

Method # 2: Stock. (Have used this for years.)
Code:
#if AMXX_VERSION_NUM == 182 stock set_ent_rendering(index, fx=kRenderFxNone, r=0, g=0, b=0, render=kRenderNormal, amount=16) {     set_pev(index, pev_renderfx, fx);     new Float:RenderColor[3];     RenderColor[0] = float(r);     RenderColor[1] = float(g);     RenderColor[2] = float(b);     set_pev(index, pev_rendercolor, RenderColor);     set_pev(index, pev_rendermode, render);     set_pev(index, pev_renderamt, float(amount)); } #endif

Compiled on Amxx 182 and tested on Amxx 110.
Code:
#include amxmodx #include engine #define iRcolor random(256) #if !defined set_ent_rendering #define set_ent_rendering set_rendering #endif public client_command(id) {     if(is_user_connected(id))     {         set_ent_rendering(id, kRenderFxGlowShell,  iRcolor,  iRcolor,  iRcolor, is_user_alive(id) ? kRenderGlow : kRenderNormal, 25);     } }

Let's complicate it slightly.
Code:
#include amxmodx #include engine #define iRcolor random(256) #if !defined set_ent_rendering #define set_ent_rendering set_rendering #define native_whateverworks set_rendering #endif public client_command(id) {     if(is_user_connected(id))     {         native_whateverworks(id, kRenderFxGlowShell,  iRcolor,  iRcolor,  iRcolor, is_user_alive(id) ? kRenderGlow : kRenderNormal, 25);     } }
Furthermore, if using Re; rendering effects may not be possible according to several testimonials.
In other words, what i want to di is impossible if i don't upgrade the AMXX version to 1.9 or newer? There aren't alternative glow functions that work on AMXX 1.8.2? Okay, i will try to upgrade the version again.
GlobalPlague is offline
lexzor
Veteran Member
Join Date: Nov 2020
Old 01-25-2023 , 13:04   Re: How to solve this "undefined symbol" error?
Reply With Quote #5

did you even read what he wrote? he just explained with examples what you have to do to make the glow effect to work

Quote:
Originally Posted by DJEarthQuake View Post
Upgrading Amxx is REQUIRED, as previously stated. Script was never intended for the passe Amxx 182. Through perseverance, glow is possible.

Last edited by lexzor; 01-25-2023 at 13:08.
lexzor is offline
GlobalPlague
Senior Member
Join Date: Feb 2016
Location: Pluto
Old 01-25-2023 , 13:38   Re: How to solve this "undefined symbol" error?
Reply With Quote #6

Quote:
Originally Posted by lexzor View Post
did you even read what he wrote? he just explained with examples what you have to do to make the glow effect to work
Sorry, i didn't read it correctly. Ok, i will try his suggestion.
GlobalPlague is offline
GlobalPlague
Senior Member
Join Date: Feb 2016
Location: Pluto
Old 01-25-2023 , 15:53   Re: How to solve this "undefined symbol" error?
Reply With Quote #7

Quote:
Originally Posted by DJEarthQuake View Post
Upgrading Amxx is REQUIRED, as previously stated. Script was never intended for the passe Amxx 182. Through perseverance, glow is possible.

Method # 1: Define. (Just made this now.)
Code:
#if !defined set_ent_rendering #define set_ent_rendering set_rendering #endif

Method # 2: Stock. (Have used this for years.)
Code:
#if AMXX_VERSION_NUM == 182 stock set_ent_rendering(index, fx=kRenderFxNone, r=0, g=0, b=0, render=kRenderNormal, amount=16) {     set_pev(index, pev_renderfx, fx);     new Float:RenderColor[3];     RenderColor[0] = float(r);     RenderColor[1] = float(g);     RenderColor[2] = float(b);     set_pev(index, pev_rendercolor, RenderColor);     set_pev(index, pev_rendermode, render);     set_pev(index, pev_renderamt, float(amount)); } #endif

Compiled on Amxx 182 and tested on Amxx 110.
Code:
#include amxmodx #include engine #define iRcolor random(256) #if !defined set_ent_rendering #define set_ent_rendering set_rendering #endif public client_command(id) {     if(is_user_connected(id))     {         set_ent_rendering(id, kRenderFxGlowShell,  iRcolor,  iRcolor,  iRcolor, is_user_alive(id) ? kRenderGlow : kRenderNormal, 25);     } }

Let's complicate it slightly.
Code:
#include amxmodx #include engine #define iRcolor random(256) #if !defined set_ent_rendering #define set_ent_rendering set_rendering #define native_whateverworks set_rendering #endif public client_command(id) {     if(is_user_connected(id))     {         native_whateverworks(id, kRenderFxGlowShell,  iRcolor,  iRcolor,  iRcolor, is_user_alive(id) ? kRenderGlow : kRenderNormal, 25);     } }
Furthermore, if using Re; rendering effects may not be possible according to several testimonials.
Thanks for the help. The first method (Define) works fine. Although i have compatibility issues between the glow function and the glow functions of other plugins, i know how to fix this by myself.

Now, i would like to know is what is the difference between the first and the second method and which method is better? And if the function doesn't exist in AMXX 1.8.2, how does the firts method solves the problem if it doesn't add new codes/functionalities?

EDIT:

If i use only this code:

Code:
#if !defined set_ent_rendering
#define set_ent_rendering set_rendering
#endif
...everything works fine.

But if i use this code:

Code:
#if AMXX_VERSION_NUM == 182
stock set_ent_rendering(index, fx=kRenderFxNone, r=0, g=0, b=0, render=kRenderNormal, amount=16)
{
    set_pev(index, pev_renderfx, fx);
    new Float:RenderColor[3];
    RenderColor[0] = float(r);
    RenderColor[1] = float(g);
    RenderColor[2] = float(b);
    set_pev(index, pev_rendercolor, RenderColor);
    set_pev(index, pev_rendermode, render);
    set_pev(index, pev_renderamt, float(amount));
}
#endif
...i get the following messages by the compiler:

zp43_gas_mask.sma(20) : error 017: undefined symbol "set_pev"
zp43_gas_mask.sma(20) : warning 215: expression has no effect
zp43_gas_mask.sma(20) : error 001: expected token: ";", but found ")"
zp43_gas_mask.sma(20) : error 029: invalid expression, assumed zero
zp43_gas_mask.sma(20) : fatal error 107: too many error messages on one line


If i combine both codes shown above, i get the following:

zp43_gas_mask.sma(22) : error 025: function heading differs from prototype
zp43_gas_mask.sma(23) : error 021: symbol already defined: "set_rendering"
zp43_gas_mask.sma(24) : error 017: undefined symbol "set_pev"
zp43_gas_mask.sma(24) : warning 215: expression has no effect
zp43_gas_mask.sma(24) : error 001: expected token: ";", but found ")"
zp43_gas_mask.sma(24) : error 029: invalid expression, assumed zero
zp43_gas_mask.sma(24) : fatal error 107: too many error messages on one line


If i use this code:

Code:
#include amxmodx
#include engine
#define iRcolor random(256)

#if !defined set_ent_rendering
#define set_ent_rendering set_rendering
#endif

public client_command(id)
{
    if(is_user_connected(id))
    {
        set_ent_rendering(id, kRenderFxGlowShell,  iRcolor,  iRcolor,  iRcolor, is_user_alive(id) ? kRenderGlow : kRenderNormal, 25);
    }
}
Glow is present even before i buy the item; i get glow the moment i join the server without having to buy the item.

So, i listed the problems. It seems the first method works best for me - i will use the first method.

Thanks.

Last edited by GlobalPlague; 01-25-2023 at 17:02.
GlobalPlague is offline
JocAnis
Veteran Member
Join Date: Jun 2010
Old 01-26-2023 , 09:30   Re: How to solve this "undefined symbol" error?
Reply With Quote #8

zp43_gas_mask.sma(20) : error 017: undefined symbol "set_pev"

->

include <fakemeta>
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)
JocAnis is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 01-26-2023 , 14:43   Re: How to solve this "undefined symbol" error?
Reply With Quote #9

@GlobalPlague. Method 1 is more efficient. Regarding Method 2, same as fm_set_ent_rendering.
__________________
DJEarthQuake 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 11:58.


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