AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   [CS:GO]Tag mismatch (custom weapon allocator) (https://forums.alliedmods.net/showthread.php?t=335527)

enghausen 12-11-2021 10:08

[CS:GO]Tag mismatch (custom weapon allocator)
 
Hi!

I am playing around with SourcePawn just to get an idea how to make plugins.

I ran into this "Tag mismatch" when making some small changes to a weapon allocator for the splewis retake plugin.

Seems like the mismatch occurs when using this function from the generic.sp in the retakes code.

Source (line 122): https://github.com/splewis/csgo-reta...kes/generic.sp

Code:

/**
 * Adds an integer to a menu as a string choice.
 */
stock void AddMenuInt(Menu menu, int value, const char[] display) {
    char buffer[INTEGER_STRING_LENGTH];
    IntToString(value, buffer, sizeof(buffer));
    menu.AddItem(buffer, display);
}

Trying to use it with this call:

Code:

public void GivePistolRMenuCT(int client) {
    Handle menu = CreateMenu(MenuHandler_PISTOLR_CT);
    SetMenuTitle(menu, "Select a CT pistol round pistol:");
    AddMenuInt(menu, pistol_choice_ct_hkp2000, "P2000");

Source (line 842): https://github.com/tmercswims/csgo-r...rdallocator.sp

Plugin seems to work, but I am really curious about the "tag mismatch"? :-)

8guawong 12-11-2021 17:34

Re: [CS:GO]Tag mismatch (custom weapon allocator)
 
try this

PHP Code:

public void GivePistolRMenuCT(int client) {
    
Menu menu CreateMenu(MenuHandler_PISTOLR_CT);
    
SetMenuTitle(menu"Select a CT pistol round pistol:");
    
AddMenuInt(menupistol_choice_ct_hkp2000"P2000"); 


enghausen 12-13-2021 06:57

Re: [CS:GO]Tag mismatch (custom weapon allocator)
 
Quote:

Originally Posted by 8guawong (Post 2765726)
try this

PHP Code:

public void GivePistolRMenuCT(int client) {
    
Menu menu CreateMenu(MenuHandler_PISTOLR_CT);
    
SetMenuTitle(menu"Select a CT pistol round pistol:");
    
AddMenuInt(menupistol_choice_ct_hkp2000"P2000"); 


Thansk a lot 8guawong! Thats was just spot on!

Have a great day!


All times are GMT -4. The time now is 08:22.

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