Raised This Month: $ Target: $400
 0% 

User buy hook [ Need help ]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
HoLLyWooD
Senior Member
Join Date: Nov 2010
Location: Ukraine Krivoy Rog
Old 01-16-2011 , 10:08   User buy hook [ Need help ]
Reply With Quote #1

A very interesting thing. Invoking the plugin is once per round and only one player! How can this be?

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "HoLLyWooD"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd"buy","clcmd_buy");
}

public 
clcmd_buy(id){
    
menu_go(id)
    
log_amx("%d call menu!",id);
}

menu_go(id){
    if(!
is_user_alive(id))
        return 
PLUGIN_HANDLED;
        
    
AwesomeMenu(id);
    return 
PLUGIN_CONTINUE;
}

public 
AwesomeMenu(id){
    new 
menu menu_create("\rLook at this awesome Menu!:""menu_handler");

    
menu_additem(menu"\wI'm Selection #1""1"0);
    
menu_additem(menu"\wI'm Selection #2""2"0);
    
menu_additem(menu"\wI'm Secret Selection #3""3"ADMIN_ADMIN);
   
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
    
menu_display(idmenu0);
 }

public 
menu_handler(idmenuitem){
    if( 
item == MENU_EXIT ){
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }

    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);
    new 
key str_to_num(data);
    
    switch(
key){
        case 
1:{
            
client_print(idprint_chat"Hooray! You selected the Awesome 1st Selection");
            
menu_destroy(menu);
            return 
PLUGIN_HANDLED;
        }
        case 
2:{
            
client_print(idprint_chat"OH NO! You selected the Awesome 2nd Selection! BEWARE!");
        }
        case 
3:{
            
client_print(idprint_chat"You have selected the Awesome Admin Selection! Hail Teh Bail!");
        }
    }

    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;


Who can help - that cake

menu get from http://forums.alliedmods.net/showthr...6364#BasicMenu
__________________

You do not know what to tell? Keep silent! You will look cleverer!
Не знаешь что сказать? Промолчи! Будешь выглядеть умней!
Статьи по скриптингу: НА РУССКОМ

Last edited by HoLLyWooD; 01-30-2011 at 14:42.
HoLLyWooD is offline
 



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 01:56.


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