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

compile error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Wooky_
Junior Member
Join Date: Aug 2017
Old 09-20-2017 , 16:34   compile error
Reply With Quote #1

PHP Code:
#include <sourcemod>

public Plugin:myinfo 
{
    
name "Music Kit Valve",
    
author "Wooky",
    
description "give music kit",
    
version "1.0",
    
url "http://steamcommunity.com/id/wooky01"


public 
OnPluginStart()
{
    
RegConsoleCmd("sm_kit"testik);
}

public 
Action testik(clientargs)
{
    new 
Handle:menu CreateMenu(testMenuAction_Select MenuAction_End);
    
SetMenuTitle(menu"MUSIC KIT");

    
AddMenuItem(menu"jedna""default");
    
AddMenuItem(menu"tri""Daniel Sadowski, Crimson Assault"); 
    
}

public 
test(Handle:menuMenuAction:actionparam1param2client)
{
    switch (
action)
    {
        case 
MenuAction_Select:
        {
            
//param1 is client, param2 is item

            
new String:item[64];
            
GetMenuItem(menuparam2itemsizeof(item));

            if (
StrEqual(item"jedna"))
            {
              
SetEntProp(clientProp_Send"m_unMusicID"1);
            }
            else if (
StrEqual(item"tri"))
            {
                
SetEntProp(clientProp_Send"m_unMusicID"3);
            }
        }

        case 
MenuAction_End:
        {
            
//param1 is MenuEnd reason, if canceled param2 is MenuCancel reason
            
CloseHandle(menu);

        }

    }

(19) : error 100: function prototypes do not match

I'm confused....

Last edited by Wooky_; 09-21-2017 at 16:33.
Wooky_ is offline
Halt
Senior Member
Join Date: Jan 2015
Location: Black Mesa
Old 09-20-2017 , 16:38   Re: compile error
Reply With Quote #2

What line is 19?

Edit:

PHP Code:
#include <sourcemod>

public Plugin:myinfo 
{
name "Music Kit Valve",
author "Wooky",
description "give music kit",
version "1.0",
url "http://steamcommunity.com/id/wooky01"


public 
OnPluginStart()
{
    
RegConsoleCmd("sm_kit"testik);
}

public 
Action testik(clientargs)
{
    new 
Handle:menu CreateMenu(testMenuAction_Select MenuAction_End);
    
SetMenuTitle(menu"MUSIC KIT");

    
AddMenuItem(menu"jedna""default");
    
AddMenuItem(menu"tri""Daniel Sadowski, Crimson Assault"); 
}

public 
test(Handle:menuMenuAction:actionparam1param2)
{
    switch (
action)
    {
    case 
MenuAction_Select:
    {
    
//param1 is client, param2 is item

    
new String:item[64];
    
GetMenuItem(menuparam2itemsizeof(item));

    if (
StrEqual(item"jedna"))
    {
    
SetEntProp(param1Prop_Send"m_unMusicID"1);
    }
    else if (
StrEqual(item"tri"))
    {
    
SetEntProp(param1Prop_Send"m_unMusicID"3);
    }
    }

    case 
MenuAction_End:
    {
    
//param1 is MenuEnd reason, if canceled param2 is MenuCancel reason
    
CloseHandle(menu);
    }
    }

1. Next time use [PHP and /PHP] or [CODE and /CODE] if you want help. Most people will ignore your post if you half ass it.
2. You didn't need client on lines 40 & 44. Param1 acts as the client index.

Last edited by Halt; 09-20-2017 at 16:45.
Halt is offline
Wooky_
Junior Member
Join Date: Aug 2017
Old 09-20-2017 , 17:00   Re: compile error
Reply With Quote #3

I'am so sorry . 19line is new Handle:menu = CreateMenu(test, MenuAction_Select | MenuAction_End
Wooky_ is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 09-20-2017 , 18:39   Re: compile error
Reply With Quote #4

For the love of god, put ur code in code blocks. Dont expect us to copy paste and nest your code just to try and help you.
__________________
Neuro Toxin is offline
fiction
Member
Join Date: May 2017
Old 09-20-2017 , 19:40   Re: compile error
Reply With Quote #5

Quite a few more errors than that. That specific error is because of this line:
PHP Code:
public test(Handle:menuMenuAction:actionparam1param2client
That 5th paramter doesn't exit, it's just menu, action, param1 and param2. Adding any more will give you the function prototypes do not match error.
Try this and read over the menu api: https://wiki.alliedmods.net/Menu_API_(SourceMod)
PHP Code:
#include <sourcemod>

public Plugin myinfo = {
    
name "Music Kit Valve",
    
author "Wooky",
    
description "give music kit",
    
version "1.0",
    
url "http://steamcommunity.com/id/wooky01"
}

public 
void OnPluginStart()
{
    
RegConsoleCmd("sm_kit"Command_Kit);
}

public 
Action Command_Kit(int clientint args)
{
    
Menu menu = new Menu(MenuHandler_Kit);
    
menu.SetTitle("MUSIC KIT");

    
menu.AddItem("jedna""default");
    
menu.AddItem("tri""Daniel Sadowski, Crimson Assault"); 
    
    
menu.Display(clientMENU_TIME_FOREVER);
    return 
Plugin_Handled;
}

public 
int MenuHandler_Kit(Menu menuMenuAction actionint param1int param2)
{
    switch(
action)
    {
        case 
MenuAction_Select:
        {
            
char sInfo[64];
            if (!
menu.GetItem(param2sInfosizeof(sInfo)))
                return 
0;

            if (
StrEqual(sInfo"jedna"))
            {
                
SetEntProp(param1Prop_Send"m_unMusicID"1);
            }
            else if (
StrEqual(sInfo"tri"))
            {
                
SetEntProp(param1Prop_Send"m_unMusicID"3);
            }
        }
        case 
MenuAction_End:
        {
            
delete menu;
        }
    }


Last edited by fiction; 09-20-2017 at 19:42.
fiction is offline
Wooky_
Junior Member
Join Date: Aug 2017
Old 09-21-2017 , 00:34   Re: compile error
Reply With Quote #6

Thank you so much everyone . I use/php next time.
Wooky_ is offline
B3none
AlliedModders Donor
Join Date: Oct 2016
Location: United Kingdom
Old 09-21-2017 , 14:38   Re: compile error
Reply With Quote #7

Quote:
Originally Posted by Neuro Toxin View Post
For the love of god, put ur code in code blocks. Dont expect us to copy paste and nest your code just to try and help you.
Agreed. Wrap your code in PHP tags
__________________
B3none is offline
Wooky_
Junior Member
Join Date: Aug 2017
Old 09-21-2017 , 16:38   Re: compile error
Reply With Quote #8

I would also like to ask. How to set the values you've chosen to retain after changing the map.
Wooky_ is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 09-21-2017 , 16:49   Re: compile error
Reply With Quote #9

Store them in globals.
__________________
Neuro Toxin 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 03:44.


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