Raised This Month: $ Target: $400
 0% 

Warning with Compiler


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mifuntm
Senior Member
Join Date: Feb 2008
Location: in space...
Old 08-12-2011 , 06:56   Warning with Compiler
Reply With Quote #1

Please check what is wrong wit code because i have warning when try compile.
Thanks!


Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Menu"
#define VERSION "1.0"
#define AUTHOR "Szymek"


public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    register_clcmd("say /menu", "menu");
    register_clcmd("say_team /menu", "menu");
}
public menu(id)
{
    new menu = menu_create("\yMenu DR", "menu_Handle");
    menu_additem(menu, "\wSlep");
    menu_additem(menu, "\wPunkty");
    menu_additem(menu, "\wRegulamin");
    menu_additem(menu, "\rCzapki");
    menu_additem(menu, "\wSzlaczek 1");
    menu_additem(menu, "\ySzlaczek 2");
    menu_additem(menu, "\ySzlaczek 3");
    menu_display(id, menu);
}
public menu_Handle(id,menu,item)
{
    if(item == MENU_EXIT)
{
    menu_destroy(menu);
    return PLUGIN_CONTINUE;
}
    menu_display(id, menu);
    switch(item)
        {
        case 0:
        {
            client_cmd(id,"say /drshop")
        }
        case 1:
        {
            client_cmd(id,"say /mypoints")
        }
        case 2:
        {
            client_cmd(id,"say /zasady")
        }
        case 3:
        {
            client_cmd(id,"say /hats")
        }
        case 4:
        {
            client_cmd(id,"say trail 10 red")
        }
        case 5:
        {
            client_cmd(id,"say trail 5 green")
        }
        case 6:
        {
            client_cmd(id,"say trail 5 yellow")
        }
}
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1045\\ f0\\ fs16 \n\\ par }
*/
__________________
Only God can judge me...
Mifuntm is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 08-12-2011 , 07:18   Re: Warning with Compiler
Reply With Quote #2

You indentation is lose, which software do u use to make plugin ?
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 08-12-2011 , 16:44   Re: Warning with Compiler
Reply With Quote #3

Quote:
Originally Posted by abdul-rehman View Post
You indentation is lose, which IDE do u use to make plugin ?
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
Mifuntm
Senior Member
Join Date: Feb 2008
Location: in space...
Old 08-12-2011 , 18:11   Re: Warning with Compiler
Reply With Quote #4

Quote:
Originally Posted by abdul-rehman View Post
You indentation is lose, which software do u use to make plugin ?

i'v found this in web
__________________
Only God can judge me...
Mifuntm is offline
Korxu
Senior Member
Join Date: Sep 2010
Old 08-12-2011 , 07:18   Re: Warning with Compiler
Reply With Quote #5

PHP Code:
#include <amxmodx>

#define PLUGIN "Menu"
#define VERSION "1.0"
#define AUTHOR "Szymek"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /menu""menu")
    
register_clcmd("say_team /menu""menu")
}

public 
menu(id)
{
    new 
menu menu_create("\yMenu DR""menu_Handle")
    
    
menu_additem(menu"\wSlep""1")
    
menu_additem(menu"\wPunkty""2")
    
menu_additem(menu"\wRegulamin""3")
    
menu_additem(menu"\rCzapki""4")
    
menu_additem(menu"\wSzlaczek 1""5")
    
menu_additem(menu"\ySzlaczek 2""6")
    
menu_additem(menu"\ySzlaczek 3""7")
    
    
menu_display(idmenu)
}

public 
menu_Handle(id,menu,item)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu);
        return 
PLUGIN_CONTINUE;
    }
    
    new 
data[6], name[64], accesscallback
    menu_item_getinfo
(menuitemaccessdata5name63callback)
    
    switch(
str_to_num(data))
    {
        case 
1:
            
client_cmd(id,"say /drshop")
        case 
2:
            
client_cmd(id,"say /mypoints")
        case 
3:
            
client_cmd(id,"say /zasady")
        case 
4:
            
client_cmd(id,"say /hats")
        case 
5:
            
client_cmd(id,"say trail 10 red")
        case 
6:
            
client_cmd(id,"say trail 5 green")
        case 
7:
            
client_cmd(id,"say trail 5 yellow")
    }
    
    
menu_destroy(menu)
    return 
PLUGIN_HANDLED

You forgot destroy the menu and return.

This will helps you ;).

@EDIT: Use [*PHP] and [*/PHP] (without *) to put codes.

Last edited by Korxu; 08-12-2011 at 07:35.
Korxu is offline
Mifuntm
Senior Member
Join Date: Feb 2008
Location: in space...
Old 08-12-2011 , 16:20   Re: Warning with Compiler
Reply With Quote #6

Quote:
Originally Posted by Korxu View Post
You forgot destroy the menu and return.

This will helps you ;).

The point is i dont want destroy menu after choosing one of options.
Every option will be opening MOTD window and closing menu should be only last option (0) Exit
__________________
Only God can judge me...
Mifuntm is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-13-2011 , 00:53   Re: Warning with Compiler
Reply With Quote #7

Quote:
Originally Posted by Mifuntm View Post
The point is i dont want destroy menu after choosing one of options.
Always destroy a menu that you don't build as a global resource (hint: you are not building it as a global resource).
__________________
fysiks is offline
Mifuntm
Senior Member
Join Date: Feb 2008
Location: in space...
Old 08-13-2011 , 07:04   Re: Warning with Compiler
Reply With Quote #8

i dont get it!
This plugin have wrong code?
__________________
Only God can judge me...

Last edited by Mifuntm; 08-13-2011 at 08:53.
Mifuntm is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-13-2011 , 16:41   Re: Warning with Compiler
Reply With Quote #9

Quote:
Originally Posted by Mifuntm View Post
i dont get it!
This plugin have wrong code?
If you want to keep showing the menu after the select an option other than exit then you need to do this at the end of menu_Hanled():

PHP Code:
    menu_destroy(menu)
    
menu(id)
    return 
PLUGIN_HANDLED 
__________________
fysiks 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:28.


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