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

[SOLVED] error 035: argument type mismatch - CreateMenu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BrUn3S
Member
Join Date: Jan 2012
Location: Slovakia
Old 07-03-2015 , 12:37   [SOLVED] error 035: argument type mismatch - CreateMenu
Reply With Quote #1

Hi guys,
I have a big problem with a piece of code..

Error:
PHP Code:
(404error 035argument type mismatch (argument 1
Code:
PHP Code:
    char callbackex[256];
    
VFormat(callbackexsizeof(callbackex), callback2);
    (
404) new Handle:menu CreateMenu(callbackexMENU_ACTIONS_ALL); 
Full code:
PHP Code:
stock menu_players(clientCsTeams:teamskipalive, const String:callback[], const String:title[], any:...)
{
    static 
i;    
    
decl String:num[32];
    
char menuname[32];
    
char name[MAX_NAME_LENGTH 1];
    
VFormat(menunamesizeof(menuname), title2);
    
    
char callbackex[256];
    
VFormat(callbackexsizeof(callbackex), callback2);
    new 
Handle:menu CreateMenu(callbackexMENU_ACTIONS_ALL);
    
    
SetMenuTitle(menumenuname);
    for(
1<= MaxClientsi++)
    {
        if(!
IsClientInGame(i) || (alive && !IsPlayerAlive(i)) || (skip == i))
            continue;
        
        if(!(
team == CS_TEAM_T || team == CS_TEAM_CT) || ((team == CS_TEAM_T || team == CS_TEAM_CT) && (GetClientTeam(i) == team)))
        {
            
GetClientName(inamesizeof(name));
            
IntToString(inumsizeof(num));
            
AddMenuItem(menunamenum);
        }
    }
    
SetMenuExitBackButton(menutrue);
    
DisplayMenu(clientmenu20);
    


Call:
PHP Code:
menu_players(clientCS_TEAM_T01"voice_enable_select""JB Voice menu"); 
Can someone help me please?
Thanks.

Last edited by BrUn3S; 07-03-2015 at 13:46.
BrUn3S is offline
Potato Uno
Veteran Member
Join Date: Jan 2014
Location: Atlanta, Georgia
Old 07-03-2015 , 12:47   Re: error 035: argument type mismatch - CreateMenu
Reply With Quote #2

PHP Code:
native Handle:CreateMenu(MenuHandler:handlerMenuAction:actions=MENU_ACTIONS_DEFAULT); 
You seem to be passing a char (string) in the handler parameter (callbackex). You should be passing a function into that parameter (which gets called when a selection is made on the menu... I think).

https://sm.alliedmods.net/api/index....d=show&id=181&

Last edited by Potato Uno; 07-03-2015 at 12:47.
Potato Uno is offline
BrUn3S
Member
Join Date: Jan 2012
Location: Slovakia
Old 07-03-2015 , 13:03   Re: error 035: argument type mismatch - CreateMenu
Reply With Quote #3

So this won't work? Or what I will need to do, to repair it?

(sorry for my Slovak-english)
BrUn3S is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 07-03-2015 , 13:13   Re: error 035: argument type mismatch - CreateMenu
Reply With Quote #4

PHP Code:
stock void MenuPlayers(int clientCsTeams teamint skipbool aliveMenuHandler callback, const char[] titleany ...)
{
    
char num[32], menuname[32], name[MAX_NAME_LENGTH 1];
    
VFormat(menunamesizeof(menuname), title7);
    
Menu menu CreateMenu(callbackMENU_ACTIONS_ALL);
    
menu.SetTitle(menuname);
    for(
int i 1<= MaxClientsi++)
    {
        if(!
IsClientInGame(i) || (alive && !IsPlayerAlive(i)) || (skip == i))
            continue;
        
        if(!(
team == CS_TEAM_T || team == CS_TEAM_CT) || ((team == CS_TEAM_T || team == CS_TEAM_CT) && (GetClientTeam(i) == team)))
        {
            
GetClientName(inamesizeof(name));
            
IntToString(inumsizeof(num));
            
menu.AddItem(namenum);
        }
    }
    
menu.ExitButton true;
    
menu.Display(client20);
    

to call:
PHP Code:
MenuPlayers(clientCS_TEAM_T01voice_enable_select"JB Voice menu"); 
__________________

Last edited by WildCard65; 07-03-2015 at 13:17.
WildCard65 is offline
BrUn3S
Member
Join Date: Jan 2012
Location: Slovakia
Old 07-03-2015 , 13:45   Re: error 035: argument type mismatch - CreateMenu
Reply With Quote #5

Yeah dude, solver.

thanks a lot

Last edited by BrUn3S; 07-03-2015 at 13:46.
BrUn3S 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 05:53.


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