Raised This Month: $ Target: $400
 0% 

Please, help-me about this scripting


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
paulinho73
Junior Member
Join Date: Nov 2009
Old 11-13-2009 , 16:18   Please, help-me about this scripting
Reply With Quote #1

Hello, I'm new in this forum. Can someone help me on sma file?
It is a menu for the public, but when I try to compile, it has at least 26 errors..

Please help me.

Thanks


# Include <amxmodx>
# Include <amxmisc>

# Define PLUGIN "Menu"
# Define AUTHOR "Player"
# Define VERSION "1.0"



plugin_init pública () (
REGISTER_PLUGIN (plugin, version, author)


register_clcmd ( "say /menu", pokaz_menu ")
)
Pokaz_menu Public (d)
(
menu_create menu = new ( "\\ yNaglowk", menu_wybor ")


menu (menu_additem, "\\ wOpcja1", "1", 0)


menu (menu_additem, "\\ wOpcja2", "2", 0)

menu (menu_additem, "\\ wOpcja3", "3", 0)

menu (menu_additem, "\\ wOpcja4", "4", 0)

menu (menu_additem, "\\ wOpcja5", "5", 0)


menu_setprop (menu MPROP_EXIT, MEXIT_ALL)


menu_display (id, menu 0)

)


Menu_wybor Public (id, menu, item)
(

if (item == MENU_EXIT)
(
menu_destroy menu ()
return PLUGIN_HANDLED
)


new data [6], iname [64]
new access, callback


menu_item_getinfo item (menu, access, data, 5, iname, 63, callback)


key str_to_num = new Date ()



switch (key)
(
case 1: (
client_cmd (id, "say that I chose option 1")
)
case 2: (
client_cmd (id, "say that I chose option 2")
)
case 3: (
client_cmd (id, "say that I chose option 3")
)
case 4: (
client_cmd (id, "say that I chose option 4")
)
case 5: (
client_cmd (id, "say that I chose option 5")
)





)
return PLUGIN_HANDLED
)
paulinho73 is offline
buklaokid
Member
Join Date: Jun 2008
Old 11-13-2009 , 17:18   Re: Please, help-me about this scripting
Reply With Quote #2

Most of your script has no declaration.
buklaokid is offline
izzle
Senior Member
Join Date: Aug 2009
Old 11-13-2009 , 19:58   Re: Please, help-me about this scripting
Reply With Quote #3

Read a tutorial like this one http://forums.alliedmods.net/showthread.php?t=46364
__________________
izzle is offline
paulinho73
Junior Member
Join Date: Nov 2009
Old 11-14-2009 , 14:24   Re: Please, help-me about this scripting
Reply With Quote #4

I wanted a menu, type, "say_menu"

Menu
1.Games
2.Anti-Cheats
3.Tops
...


Some of those menus give for it?

Thanks for the reply.
paulinho73 is offline
floatman
Senior Member
Join Date: Oct 2009
Location: nowhere.
Old 11-14-2009 , 14:45   Re: Please, help-me about this scripting
Reply With Quote #5

PHP Code:
#include <amxmodx>


new const VERSION[] = "0.1"

public plugin_init()
{
    
register_plugin("Simple menu"VERSION"floatman");

    
register_clcmd("say /menu""cmdMenu");
    
register_clcmd("say_team /menu""cmdMenu");
}

public 
cmdMenu(id)
{
    new 
szMenu menu_create("\rMy menu:""menu_handler");

    
menu_additem(szMenu"My 1st item""1"0);
    
menu_additem(szMenu"My 2nd item""2"0);
    
menu_additem(szMenu"My 3rd item""3"0);
    
menu_additem(szMenu"My 4th item""4"0);

    
menu_setprop(szMenuMPROP_EXITMEXIT_ALL);
    
menu_display(idszMenu0);
}

public 
menu_handler(idszMenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(szMenu);
        return 
PLUGIN_HANDLED;
    }

    new 
szData[6], iName[64];
    new 
szAccessszCallBack;

    
menu_item_getinfo(szMenuitemszAccessszData5iName63szCallBack);

    new 
szKey str_to_num(szData)

    switch(
szKey)
    {
        case 
1:
        {
            
client_cmd(id"say I choose first option");
        }
        case 
2:
        {
            
client_cmd(id"say Whatever");
        }
        case 
3:
        {
            
client_cmd(id"say something");
        }
        
    }
    
menu_destroy(szMenu);
    return 
PLUGIN_HANDLED;

You will see your mistakes.
__________________


Last edited by floatman; 11-14-2009 at 14:48.
floatman is offline
paulinho73
Junior Member
Join Date: Nov 2009
Old 11-14-2009 , 14:50   Re: Please, help-me about this scripting
Reply With Quote #6

Thank you for your help.
To add something, I can add with some command or have to change the sma file and recompile?

Thanks
paulinho73 is offline
paulinho73
Junior Member
Join Date: Nov 2009
Old 11-14-2009 , 14:54   Re: Please, help-me about this scripting
Reply With Quote #7

When I try to compile, the following appears:

Your plugin failed to compile!
Read the errors below:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

/groups/amxmodx/tmp3/textM5m0Eb.sma(25) : error 017: undefined symbol "menu_dispaly"
/groups/amxmodx/tmp3/textM5m0Eb.sma(39) : error 017: undefined symbol "szCallBack"
/groups/amxmodx/tmp3/textM5m0Eb.sma(39) : error 088: number of arguments does not match definition
/groups/amxmodx/tmp3/textM5m0Eb.sma(61) : warning 203: symbol is never used: "szCallback"

3 Errors.
Could not locate output file /home/groups/amxmodx/public_html/websc3/textM5m0Eb.amx (compile failed).
paulinho73 is offline
floatman
Senior Member
Join Date: Oct 2009
Location: nowhere.
Old 11-14-2009 , 14:54   Re: Please, help-me about this scripting
Reply With Quote #8

Quote:
Originally Posted by paulinho73 View Post
Thank you for your help.
To add something, I can add with some command or have to change the sma file and recompile?

Thanks
Change the sma file and recompile it.
You're welcome.
__________________

floatman is offline
paulinho73
Junior Member
Join Date: Nov 2009
Old 11-14-2009 , 15:05   Re: Please, help-me about this scripting
Reply With Quote #9

When I try to compile, the following appears:

Your plugin failed to compile!
Read the errors below:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

/groups/amxmodx/tmp3/textM5m0Eb.sma(25) : error 017: undefined symbol "menu_dispaly"
/groups/amxmodx/tmp3/textM5m0Eb.sma(39) : error 017: undefined symbol "szCallBack"
/groups/amxmodx/tmp3/textM5m0Eb.sma(39) : error 088: number of arguments does not match definition
/groups/amxmodx/tmp3/textM5m0Eb.sma(61) : warning 203: symbol is never used: "szCallback"

3 Errors.
Could not locate output file /home/groups/amxmodx/public_html/websc3/textM5m0Eb.amx (compile failed).
paulinho73 is offline
matsi
Thinkosaur
Join Date: Sep 2006
Old 11-14-2009 , 15:09   Re: Please, help-me about this scripting
Reply With Quote #10

Quote:
Originally Posted by paulinho73 View Post
When I try to compile, the following appears:

Your plugin failed to compile!
Read the errors below:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

/groups/amxmodx/tmp3/textM5m0Eb.sma(25) : error 017: undefined symbol "menu_dispaly"
/groups/amxmodx/tmp3/textM5m0Eb.sma(39) : error 017: undefined symbol "szCallBack"
/groups/amxmodx/tmp3/textM5m0Eb.sma(39) : error 088: number of arguments does not match definition
/groups/amxmodx/tmp3/textM5m0Eb.sma(61) : warning 203: symbol is never used: "szCallback"

3 Errors.
Could not locate output file /home/groups/amxmodx/public_html/websc3/textM5m0Eb.amx (compile failed).
When i try to compile, the following appears:

Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

Header size: 344 bytes
Code size: 1288 bytes
Data size: 800 bytes
Stack/heap size: 16384 bytes; estimated max. usage=87 cells (348 bytes)
Total requirements: 18816 bytes
Done.

Compilation Time: 0,50 sec
matsi 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 07:23.


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