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

Tag Mismatch - ReAPI


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Shadypastbrightfuture
Junior Member
Join Date: Sep 2020
Location: Sky
Old 11-07-2021 , 10:16   Tag Mismatch - ReAPI
Reply With Quote #1

Hi Everyone,

I am compiling ReCTF plugin and getting tag mismatch on this function.

rg_set_user_bpammo(id, iWeapon, g_iBPAmmo[iWeapon])

Code:
for(new iWeapon, i = 2; i >= 1; i--)
	{
		iWeapon = 0

		if(strlen(szWeapon[i]))
		{
			for(new w = 1; w < sizeof g_szWeaponCommands; w++)
			{
				if(g_iWeaponSlot[w] == i && equali(szWeapon[i], g_szWeaponCommands[w][0]))
				{
					iWeapon = w
					break
				}
			}

			if(iWeapon)
			{
				rg_give_item(id, g_szWeaponEntity[iWeapon], GT_REPLACE)
				rg_set_user_bpammo(id, iWeapon, g_iBPAmmo[iWeapon])
This is native in ReAPI

Code:
/*
* Sets the amount of ammo in the client's backpack for a specific weapon.
*
* @param index      Client index
* @param weapon     Weapon id
* @param amount     New backpack ammo amount to set
*
* @noreturn
*/
native rg_set_user_bpammo(const index, WeaponIdType:weapon, amount);
g_iBPAmmo list is like this

Code:
new const g_iBPAmmo[] =
{
	0,		// (unknown)
	52,		// P228
	0,		// SHIELD and so on for all weapons
Please let me know what's wrong here. Thanks!
Attached Files
File Type: sma Get Plugin or Get Source (reapi_jctf.sma - 154 views - 157.6 KB)
Shadypastbrightfuture is offline
JusTGo
Veteran Member
Join Date: Mar 2013
Old 11-07-2021 , 12:13   Re: Tag Mismatch - ReAPI
Reply With Quote #2

post the full error.
__________________
JusTGo is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-07-2021 , 12:15   Re: Tag Mismatch - ReAPI
Reply With Quote #3

Try: rg_set_user_bpammo(id, WeaponIdType:iWeapon, g_iBPAmmo[iWeapon])
__________________
Bugsy is offline
Shadypastbrightfuture
Junior Member
Join Date: Sep 2020
Location: Sky
Old 11-20-2021 , 08:29   Re: Tag Mismatch - ReAPI
Reply With Quote #4

Quote:
Originally Posted by JusTGo View Post
post the full error.
Not an error, just warning.
Code:
//// reapi_jctf.sma
//
// E:\reapi_jctf.sma(5512) : warning 213: tag mismatch
// E:\reapi_jctf.sma(5521) : warning 213: tag mismatch
// E:\reapi_jctf.sma(5521) : warning 213: tag mismatch
// E:\reapi_jctf.sma(5521) : warning 213: tag mismatch
// E:\reapi_jctf.sma(5743 -- 5744) : warning 213: tag mismatch
// E:\reapi_jctf.sma(5754 -- 5755) : warning 213: tag mismatch
// Header size:           5728 bytes
// Code size:           117748 bytes
// Data size:            85328 bytes
// Stack/heap size:      16384 bytes
// Total requirements:  225188 bytes
//
// 6 Warnings.
// Done.

Quote:
Originally Posted by Bugsy View Post
Try: rg_set_user_bpammo(id, WeaponIdType:iWeapon, g_iBPAmmo[iWeapon])
Still the same warning. Thanks for the response though.

The g_iBPAmmo list contains int value of amount of ammo.
does it accept CSW_* name of weapon as wepaonIDType?
if it does, is their any way to get that value using this.
Shadypastbrightfuture is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 11-20-2021 , 09:16   Re: Tag Mismatch - ReAPI
Reply With Quote #5

If I remember correctly it's something like that.

Code:
if(iWeapon)
			{
				new WeaponName[32]
 				get_weaponname(iWeapon, WeaponName, charsmax(WeaponName))

				//give_item(id, g_szWeaponEntity[iWeapon])
				//reapi
				rg_give_item(id, g_szWeaponEntity[iWeapon], GT_REPLACE)
				//cs_set_user_bpammo(id, iWeapon, g_iBPAmmo[iWeapon])
				//reapi
				rg_set_user_bpammo(id, WeaponIdType:get_weaponid(WeaponName), g_iBPAmmo[iWeapon])
			}
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-20-2021 , 11:10   Re: Tag Mismatch - ReAPI
Reply With Quote #6

g_iBPAAmmo[] wants the CSW_ weapon ID as the index.

In the for loop in your original post, w holds the CSW_ weapon index.
__________________
Bugsy 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 23:46.


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