Raised This Month: $ Target: $400
 0% 

Warning with Compiler


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Korxu
Senior Member
Join Date: Sep 2010
Old 08-12-2011 , 07:18   Re: Warning with Compiler
Reply With Quote #1

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 #2

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 #3

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
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