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

How to fix these two errors: "loose indentation" and "undefined symbol"?


Post New Thread Reply   
 
Thread Tools Display Modes
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 11-15-2021 , 13:16   Re: How to fix these two errors: "loose indentation" and "undefined symbol"?
Reply With Quote #11

You didn't answer the question tho. Let me ask differently: is your zm server hosted somewhere or it is on your computer? If it's hosted then you shouldn't be adding the inc files to it, you should be adding the includes to the actual compiler folder.
Please give a simple answer: hosted or on your pc.

Also, did you actually check if the include files you downloaded contain the native that was missing? If they don't, then adding them won't change a thing.
Moreover, did you follow my suggestion to try replacing the missing native with get_user_weapon?
__________________

Last edited by HamletEagle; 11-15-2021 at 13:18.
HamletEagle is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-15-2021 , 22:32   Re: How to fix these two errors: "loose indentation" and "undefined symbol"?
Reply With Quote #12

Because DJEarthQuake is making very unclear posts, I'll state it myself. Try replacing wpn_uses_weapon with wpn_has_weapon.

@HamletEagle, I suspect that he's placing them in the correct place because he's not getting the missing include file error. The original plugin uses a function that doesn't exist in the referenced dependency so when you have the include files in the correct place, you will indeed get an undefined symbol error.
__________________

Last edited by fysiks; 11-16-2021 at 21:05.
fysiks is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 11-16-2021 , 00:37   Re: How to fix these two errors: "loose indentation" and "undefined symbol"?
Reply With Quote #13

Replacing wpn_uses_weapon with wpn_has_weapon will get it to compile but it takes more to fix it. Here is tested complete fix in case anybody needs. Wpn_gameinfo_cs.sma plugin was also hosed sticking players in freeze-time indefinitely. If you plan on using my copy of wpn_hivehand for ZP one will need to uncomment the define. I did not want to install all that stuff at end of the day yesterday when I was still working on my work too. It takes a plethora of plugins to make wpn_hivehand materialize.
Quote:
Originally Posted by fysiks View Post
replacing wpn_uses_weapon with wpn_has_weapon.
In a nutshell.
Code:
public fwd_PostThink ( id ) if ( is_user_alive ( id ) && wpn_has_weapon ( id, gi_Weaponid ) )     b_ReadyFire[id] = true public fwd_PreThink ( id ) if(b_ReadyFire[id]) {     Hornet_Reload ( id );     WeaponIdle ( id ); }
__________________

Last edited by DJEarthQuake; 11-16-2021 at 19:05. Reason: Mistype
DJEarthQuake is offline
Old 11-17-2021, 17:07
CrazY.
This message has been deleted by asherkin.
GlobalPlague
Senior Member
Join Date: Feb 2016
Location: Pluto
Old 11-18-2021 , 03:53   Re: How to fix these two errors: "loose indentation" and "undefined symbol"?
Reply With Quote #14

Quote:
Originally Posted by HamletEagle View Post
You didn't answer the question tho. Let me ask differently: is your zm server hosted somewhere or it is on your computer? If it's hosted then you shouldn't be adding the inc files to it, you should be adding the includes to the actual compiler folder.
Please give a simple answer: hosted or on your pc.

Also, did you actually check if the include files you downloaded contain the native that was missing? If they don't, then adding them won't change a thing.
Moreover, did you follow my suggestion to try replacing the missing native with get_user_weapon?
The error is solved.

I replaced "uses" with "has":

Code:
wpn_uses_weapon
=====>
Code:
wpn_has_weapon
This is the correct way to do it, right?

What is the difference between "uses" and "has" in the context of AMXX?

Sadly, the warning is still there and I don't know how to fix it. To me, this is how "else" should be like:

Code:
	   }
	   else
	   {
"C:\Mod\cstrike\addons\amxmodx\scripting\zp_w p n_hivehand11.sma(735) : warning 217: loose indentation"

This is on line 735:

Code:
	   else
This is the full code:

Code:
    DieTouch ( const i_Ent, const i_Other )
    {
        if ( CanTakeDamage ( i_Other ) )
        {
            if (!zp_get_user_zombie(i_Other) || zp_get_user_nemesis(i_Other))
	   {
		switch ( random_num ( 0, 2 ) )
		{
			case 0 : emit_sound ( i_Ent, CHAN_VOICE, gs_Hit1Sound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
			case 1 : emit_sound ( i_Ent, CHAN_VOICE, gs_Hit2Sound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
			case 2 : emit_sound ( i_Ent, CHAN_VOICE, gs_Hit3Sound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
		}

		wpn_damage_user( gi_Weaponid, i_Other, pev ( i_Ent, pev_owner ), 0, HORNET_DAMAGE, DMG_BULLET | DMG_NEVERGIB );
	   }
	   else
	   {
	   	wpn_damage_user(gi_Weaponid, i_Other, pev (i_Ent, pev_owner), 0, 0, DMG_BULLET | DMG_NEVERGIB);
	   }
        }

        set_pev ( i_Ent, pev_modelindex, 0 );
        set_pev ( i_Ent, pev_solid, SOLID_NOT );

        set_pev ( i_Ent, HG_THINK_STEP, RemoveHornet );
        set_pev ( i_Ent, pev_nextthink, get_gametime () + 1.0 );

        return FMRES_IGNORED;
    }
Also, this is the message I get in the console of my server:

"[AMXX] Plugin "zp_wpn_hivehand11.amxx" failed to load: Module/Library "WeaponMod" required for plugin. Check modules.ini."

I don't know how to find the module. Every time when I try to find this module, I get results that are not related to the .dll file - weaponmod.dll. I get only results about plugins that add new types of weapons to your server, but I don't get results about the weaponmod.dll file.
GlobalPlague is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 11-18-2021 , 14:56   Re: How to fix these two errors: "loose indentation" and "undefined symbol"?
Reply With Quote #15

if (!zp_get_user_zombie(i_Other) || zp_get_user_nemesis(i_Other)) is off 1 space. That's causing the warning. There is no module. It is the plugin weaponmod that is not loaded. Have to install the plugin and at least 2 to 3 more not just copy include files.
__________________
DJEarthQuake is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-18-2021 , 20:55   Re: How to fix these two errors: "loose indentation" and "undefined symbol"?
Reply With Quote #16

Quote:
Originally Posted by GlobalPlague View Post
What is the difference between "uses" and "has" in the context of AMXX?
This function is not part of AMX Mod X so those two words don't mean anything in the context of AMX Mod X. Function names defined in plugins (ones not defined by AMX Mod X; this one is defined in the weaponmod plugin) can basically be called whatever the author wants. I can only assume that the author made some sort of typo or mistake before uploading it.
__________________
fysiks is offline
GlobalPlague
Senior Member
Join Date: Feb 2016
Location: Pluto
Old 11-19-2021 , 08:19   Re: How to fix these two errors: "loose indentation" and "undefined symbol"?
Reply With Quote #17

Quote:
Originally Posted by DJEarthQuake View Post
if (!zp_get_user_zombie(i_Other) || zp_get_user_nemesis(i_Other)) is off 1 space. That's causing the warning.
What do you mean by "one space off"? Here is a picture of the code: https://pasteboard.co/24lV5RWGVdC8.png

Tell me what I have to change.

Quote:
Originally Posted by DJEarthQuake View Post
There is no module. It is the plugin weaponmod that is not loaded. Have to install the plugin and at least 2 to 3 more not just copy include files.
Thanks for explaining to me. When I added the weaponmod plugin, too, I got 2 errors.

After I changed this:
Code:
wpn_uses_weapon
to this:
Code:
wpn_has_weapon
the compiler now compiles the HiveHand plugin, without showing any errors. The Hivehand is shown as an extra item in the zombies' shop, too. However, when you try to buy the Hivehand, you get nothing.

After I enabled the "debug" mode of the plugin, I got these two errors in the "logs" folder:

L 11/19/2021 - 149:28: Start of error session.
L 11/19/2021 - 149:28: Info (map "zm_ice_attack3") (file "addons/amxmodx/logs/error_20211119.log")
L 11/19/2021 - 149:28: Invalid CVAR pointer
L 11/19/2021 - 149:28: [AMXX] Displaying debug trace (plugin "zp_wpn_hivehand11.amxx")
L 11/19/2021 - 149:28: [AMXX] Run time error 10: native error (native "get_pcvar_num")
L 11/19/2021 - 149:28: [AMXX] [0] zp_wpn_hivehand11.sma::plugin_cfg (line 312)
L 11/19/2021 - 1492: Called dynanative into a paused plugin.
L 11/19/2021 - 1492: [AMXX] Displaying debug trace (plugin "zp_wpn_hivehand11.amxx")
L 11/19/2021 - 1492: [AMXX] Run time error 10: native error (native "wpn_has_weapon")
L 11/19/2021 - 1492: [AMXX] [0] zp_wpn_hivehand11.sma::fwd_PreThink (line 600)


This is line 312:

Code:
        gi_FriendlyFire = get_pcvar_num ( get_cvar_pointer ( "wpn_friendlyfire" ) );
This is the whole code:

Code:
    public plugin_cfg ()
    {
        gi_HornetClass  = engfunc ( EngFunc_AllocString, "info_target" );
        gi_MaxEntities  = global_get ( glb_maxEntities );
        gi_FriendlyFire = get_pcvar_num ( get_cvar_pointer ( "wpn_friendlyfire" ) );
        
        CreateWeapon ();
    }
This is line 600:
Code:
        if ( is_user_alive ( id ) && wpn_has_weapon( id, gi_Weaponid ) )
This is the whole code:
Code:
    public fwd_PreThink ( id )
    {
        if ( is_user_alive ( id ) && wpn_has_weapon( id, gi_Weaponid ) )
        {
            Hornet_Reload ( id );
            WeaponIdle ( id );
        }
    }
So, when it was "wpn_uses_weapon", the compiler showed errors about "uses" being an undefined symbol. When "uses" was changed to "has", the compiler showed no errors, but the plugin still doesn't work properly.

Quote:
Originally Posted by fysiks View Post
This function is not part of AMX Mod X so those two words don't mean anything in the context of AMX Mod X. Function names defined in plugins (ones not defined by AMX Mod X; this one is defined in the weaponmod plugin) can basically be called whatever the author wants. I can only assume that the author made some sort of typo or mistake before uploading it.
Thanks for explaining.

Last edited by GlobalPlague; 11-19-2021 at 08:20.
GlobalPlague is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 11-20-2021 , 02:54   Re: How to fix these two errors: "loose indentation" and "undefined symbol"?
Reply With Quote #18

Indent is in tabs or spaces. Use backspace on that line to make it flush with bracket below it. Notice the compiler had you looking several lines lower when the issue is up higher. File that away.

Before
Code:
            if (!zp_get_user_zombie(i_Other) || zp_get_user_nemesis(i_Other))
	   {
After
Code:
           if (!zp_get_user_zombie(i_Other) || zp_get_user_nemesis(i_Other))
	   {
The rest of your dilemma stems from not reading the installation directions very carefully for mod and flat out ignoring everything I said in post 13. Use my fixed version of Wpn_gameinfo_cs.sma. It is not installed at all otherwise that pause would not have come up typically. Install the weapon give system so can see the hive in your hand. Once that works then try Zombie shop.
__________________

Last edited by DJEarthQuake; 11-22-2021 at 08:57. Reason: words transposed
DJEarthQuake is offline
GlobalPlague
Senior Member
Join Date: Feb 2016
Location: Pluto
Old 11-22-2021 , 14:43   Re: How to fix these two errors: "loose indentation" and "undefined symbol"?
Reply With Quote #19

DJEarthQuake, the plugin you recommended me, wpn_gameinfo_cs.sma, doesn't work. It gives multiple errors, including "run time" errors, too. I'm giving up on the HiveHand plugin. I no longer want to add it to my server.

I'm thankful to everyone who tried to help me with the HiveHand plugin. Sadly, it didn't work.
I will simply add other extra items, instead of the HiveHand.

Thanks, anyway.

Last edited by GlobalPlague; 11-22-2021 at 14:44.
GlobalPlague is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 11-23-2021 , 08:26   Re: How to fix these two errors: "loose indentation" and "undefined symbol"?
Reply With Quote #20

wpn_gameinfo_cs.sma is an essential part of weaponmod and it ran error-free for me. Without it, the hivehand will not work. When I installed plugin the freeze time was being applied after freezetime instead of during. That was easily corrected. I do not have any errors in my logs.
__________________
DJEarthQuake 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 18:31.


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