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

Solved Error 100: Function prototypes do not match


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Enes05
Junior Member
Join Date: Feb 2018
Location: Istanbul | Turkey
Old 10-05-2018 , 16:29   Error 100: Function prototypes do not match
Reply With Quote #1

PHP Code:
public Action bunny(clientId
{
    new 
Handle:menu CreateMenu(BunnyMenu);
    
SetMenuTitle(menu"Bunny Açık mı yoksa Kapalı mı olsun?");
    
decl String:menu_bunny[124];
    
    
Format(menu_bunny124"Bunny Aç");
    
AddMenuItem(menu"option2"menu_bunny);
    
    
Format(menu_bunny124"Bunny Kapat");
    
AddMenuItem(menu"option3"menu_bunny);    
    
    
SetMenuExitButton(menutrue);
    
DisplayMenu(menuclientIdMENU_TIME_FOREVER);
    
    return 
Plugin_Handled;
}

public 
int BunnyMenu(Handle:menuMenuAction:actionclientitemNumargs)
{
    
decl String:isim[32];
    
GetClientName(clientisimsizeof(isim));
    
    if ( 
action == MenuAction_Select 
    {
        new 
String:info[32];
        
GetMenuItem(menuitemNuminfosizeof(info));
        if(
strcmp(info,"option2") == 0)
        {
            
SetCvar("bunny_enable",1);
            
SetCvar("abner_bhop",1);
            
SetCvar("sv_enablebunnyhopping",1);
            
SetCvar("sv_autobunnyhopping",1);
            
SetCvar("sv_gravity ",800);
            
FFSaniyeler(client);
        }
        else if (
strcmp(info,"option3") == 0)
        {
            
SetCvar("bunny_enable",0);
            
SetCvar("abner_bhop",0);
            
SetCvar("sv_enablebunnyhopping",0);
            
SetCvar("sv_autobunnyhopping",0);
            
SetCvar("sv_gravity ",800);
            
FFSaniyeler(client);
        }
    }

What is the problem?

Last edited by Enes05; 10-05-2018 at 16:47.
Enes05 is offline
Enes05
Junior Member
Join Date: Feb 2018
Location: Istanbul | Turkey
Old 10-05-2018 , 16:34   Re: Error 100: Function prototypes do not match
Reply With Quote #2

Error row:
new Handle:menu = CreateMenu(BunnyMenu);
Enes05 is offline
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 10-05-2018 , 16:44   Re: Error 100: Function prototypes do not match
Reply With Quote #3

(Handle:menu, MenuAction:action, client, itemNum, args)

->

(Handle:menu, MenuAction:action, client, itemNum)
mug1wara is offline
cra88y
AlliedModders Donor
Join Date: Dec 2016
Old 10-05-2018 , 16:45   Re: Error 100: Function prototypes do not match
Reply With Quote #4

Try new syntax after giving this a read:
https://wiki.alliedmods.net/Menu_API_(SourceMod)

Should be simpler and fix your issues if you replicate what the guide does
cra88y is offline
Enes05
Junior Member
Join Date: Feb 2018
Location: Istanbul | Turkey
Old 10-05-2018 , 16:46   Re: Error 100: Function prototypes do not match
Reply With Quote #5

Thanks!
Fixed
Enes05 is offline
shanapu
Veteran Member
Join Date: Apr 2015
Location: .de
Old 10-05-2018 , 16:47   Re: Error 100: Function prototypes do not match
Reply With Quote #6

https://sm.alliedmods.net/new-api/menus/MenuHandler
Code:
typedef MenuHandler = function int(Menu menu, MenuAction action, int param1, int param2)
the menu callback has only 4 parameters.
your call back use 5 parameters. (args is to much),
Code:
public int BunnyMenu(Handle:menu, MenuAction:action, client, itemNum, args)
edit: wow 3 posts while I'm writing...
__________________
coding & free software

Last edited by shanapu; 10-05-2018 at 16:48.
shanapu is offline
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 10-05-2018 , 16:52   Re: Error 100: Function prototypes do not match
Reply With Quote #7

Quote:
Originally Posted by shanapu View Post
https://sm.alliedmods.net/new-api/menus/MenuHandleredit: wow 3 posts while I'm writing...
even thogh this has nothing to do with the thread:
lmao, everyone can relate
mug1wara is offline
Enes05
Junior Member
Join Date: Feb 2018
Location: Istanbul | Turkey
Old 10-05-2018 , 16:53   Re: Error 100: Function prototypes do not match
Reply With Quote #8

Quote:
Originally Posted by Enes05 View Post
PHP Code:
public Action bunny(clientId
{
    new 
Handle:menu CreateMenu(BunnyMenu);
    
SetMenuTitle(menu"Bunny Açık mı yoksa Kapalı mı olsun?");
    
decl String:menu_bunny[124];
    
    
Format(menu_bunny124"Bunny Aç");
    
AddMenuItem(menu"option2"menu_bunny);
    
    
Format(menu_bunny124"Bunny Kapat");
    
AddMenuItem(menu"option3"menu_bunny);    
    
    
SetMenuExitButton(menutrue);
    
DisplayMenu(menuclientIdMENU_TIME_FOREVER);
    
    return 
Plugin_Handled;
}

public 
int BunnyMenu(Handle:menuMenuAction:actionclientitemNumargs)
{
    
decl String:isim[32];
    
GetClientName(clientisimsizeof(isim));
    
    if ( 
action == MenuAction_Select 
    {
        new 
String:info[32];
        
GetMenuItem(menuitemNuminfosizeof(info));
        if(
strcmp(info,"option2") == 0)
        {
            
SetCvar("bunny_enable",1);
            
SetCvar("abner_bhop",1);
            
SetCvar("sv_enablebunnyhopping",1);
            
SetCvar("sv_autobunnyhopping",1);
            
SetCvar("sv_gravity ",800);
            
FFSaniyeler(client);
        }
        else if (
strcmp(info,"option3") == 0)
        {
            
SetCvar("bunny_enable",0);
            
SetCvar("abner_bhop",0);
            
SetCvar("sv_enablebunnyhopping",0);
            
SetCvar("sv_autobunnyhopping",0);
            
SetCvar("sv_gravity ",800);
            
FFSaniyeler(client);
        }
    }

What is the problem?
Quote:
Originally Posted by shanapu View Post
https://sm.alliedmods.net/new-api/menus/MenuHandler
Code:
typedef MenuHandler = function int(Menu menu, MenuAction action, int param1, int param2)
the menu callback has only 4 parameters.
your call back use 5 parameters. (args is to much),
Code:
public int BunnyMenu(Handle:menu, MenuAction:action, client, itemNum, args)
edit: wow 3 posts while I'm writing...
Thanks for information
Enes05 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 16:23.


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