AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Another "tag mismatch" warning (https://forums.alliedmods.net/showthread.php?t=335430)

GlobalPlague 12-04-2021 05:08

Another "tag mismatch" warning
 
Hello. I introduced some changes to a plugin, and now when I try to compile it, the compiler shows the following warning:

"C:\Mod\cstrike\addons\amxmodx\scripting\zomb ie_plague_advance_v1-6-1.sma(13798) : warning 213: tag mismatch"

This is the part of the code I edited, and line 13798 is marked in red:

Code:

public zombie_countdown()
{   
        new speak[ 10 ][] = { "fvox/zp_one.wav", "fvox/zp_two.wav", "fvox/zp_three.wav", "fvox/zp_four.wav", "fvox/zp_five.wav", "fvox/zp_six.wav", "fvox/zp_seven.wav", "fvox/zp_eight.wav", "fvox/zp_nine.wav", "fvox/zp_ten.wav" }
       
        emit_sound( 0, CHAN_VOICE, speak[ countdown ], 1.0, ATTN_NORM, 0, PITCH_NORM )
        countdown--
       
        set_dhudmessage(0, 0, 255, -1.0, 0.28, 2, 0.02, 1.0, 0.01, 0.1, 10);
        show_dhudmessage(0, "Infection in %i", time_s);
        --time_s;
       
        if(time_s >= 1)
        {
                set_task(1.0, "zombie_countdown")
        }
}

The warning means I have to delete a number from that line, but I don't know which number I need to delete. Usually, after I replace HUD with DHUD, i need to delete the "-1" value that i often see at the end of the line, but this time the code is different and i don't know which number to delete.

Would you help me?

Also, it would be good if someone explains to me what exactly "tag mismatch" means, so I can learn how to fix such type of warnings by myself.

Thanks.

thEsp 12-04-2021 05:10

Code:

set_dhudmessage(0, 0, 255, -1.0, 0.28, 2, 0.02, 1.0, 0.01, 0.1, 10.0);

GlobalPlague 12-04-2021 05:23

Re: Another "tag mismatch" warning
 
Quote:

Originally Posted by thEsp (Post 2764987)
Code:

set_dhudmessage(0, 0, 255, -1.0, 0.28, 2, 0.02, 1.0, 0.01, 0.1, 10.0);

Adding ".0" after the "10" at the end of the line, didn't solve the problem. I still get the same warning.

DJEarthQuake 12-04-2021 06:54

Re: Another "tag mismatch" warning
 
I see 11 arguments where there should be 10.
The ,10 sticks out. What is this ,10 supposed to do?

Study this.
https://www.amxmodx.org/api/amxmodx/set_dhudmessage
Code:

native set_dhudmessage(red = 200, green = 100, blue = 0, Float:x = -1.0, Float:y = 0.35, effects = 0, Float:fxtime = 6.0, Float:holdtime = 12.0, Float:fadeintime = 0.1, Float:fadeouttime = 0.2);

GlobalPlague 12-04-2021 07:28

Re: Another "tag mismatch" warning
 
Quote:

Originally Posted by DJEarthQuake (Post 2764992)
I see 11 arguments where there should be 10.
The ,10 sticks out. What is this ,10 supposed to do?

Study this.
https://www.amxmodx.org/api/amxmodx/set_dhudmessage
Code:

native set_dhudmessage(red = 200, green = 100, blue = 0, Float:x = -1.0, Float:y = 0.35, effects = 0, Float:fxtime = 6.0, Float:holdtime = 12.0, Float:fadeintime = 0.1, Float:fadeouttime = 0.2);

What is this ,10 supposed to do?

The ",10" was there, in the default code of the plugin, before i changed HUD into DHUD.

Thanks for your help. The problem is solved.

Yeah, I have to learn how to deal with these arguments.

DJEarthQuake 12-04-2021 09:05

Re: Another "tag mismatch" warning
 
You are welcome. Soft coding is technique for such. Instead of 'SzString of unmarked iNumbers' suddenly the code is personified. Mistakes are easier to spot.

fysiks 12-04-2021 14:24

Re: Another "tag mismatch" warning
 
Simply look at the function definition to see how many arguments and of what type you need.


All times are GMT -4. The time now is 11:38.

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