Raised This Month: $ Target: $400
 0% 

One menu blocks other to show up!


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
spiN-
Member
Join Date: Jul 2008
Location: Lithuania
Old 08-24-2009 , 10:56   Re: One menu blocks other to show up!
Reply With Quote #7

Man, I still can't get it to work... Can someone make that this menu will show up after some time?
Code:
#include <amxmodx>
#include <cstrike> 
#include <fakemeta> 
#include <fun>
#include <hamsandwich>

new bool:FirstSpawn[33]

 public plugin_init()
 {

    register_plugin("ExtraMenu","1.0","spiN-")
    RegisterHam        (Ham_Spawn, "player", "Player_Spawn", 1)  

 }
 
 public Player_Spawn(id) 
{ 
    if( !is_user_alive(id) ) 
    
        { 
            FirstSpawn[id] = true 
            return 
        } 
    FirstSpawn[id] = false
    
    new menu = menu_create("\rMenu:", "menu_handler");

    menu_additem(menu, "\wExtra Weapons", "1", ADMIN_LEVEL_D);
    menu_additem(menu, "\wExtra Health", "2", ADMIN_LEVEL_D);

    menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);

    menu_display(id, menu, 0);
 
 }
 
 public menu_handler(id, menu, item)
 {
    
    if( item == MENU_EXIT )
    {
        menu_destroy(menu);
        
        return PLUGIN_HANDLED;
    }

    new data[6], iName[64];
    new access, callback;
    
    menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);

    new key = str_to_num(data);

    switch(key)
    {
        case 1:
        {
            strip_user_weapons (id)  
            give_item( id, "weapon_m4a1" ); 
            give_item( id, "ammo_556nato" ); 
            give_item( id, "ammo_556nato" ); 
            give_item( id, "ammo_556nato" ); 
            give_item( id, "weapon_deagle" ); 
            give_item( id, "ammo_50ae" ); 
            give_item( id, "ammo_50ae" );          
            give_item( id, "ammo_50ae" ); 
            give_item( id, "ammo_50ae" ); 
            give_item( id, "ammo_50ae" ); 
            give_item( id, "ammo_50ae" ); 
            give_item( id, "weapon_hegrenade" );
            give_item( id, "weapon_flashbang" ); 
            give_item( id, "weapon_flashbang" ); 
            give_item( id, "weapon_smokegrenade" ); 
            give_item( id, "weapon_knife" ); 
            client_print(id, print_chat, "You get M4A1, Deagle and Grenades!");
            menu_destroy(menu);
            return PLUGIN_HANDLED;
        }
        case 2:
        {
            set_user_health( id, get_user_health( id ) + 100 );
            client_print(id, print_chat, "You get +100 HP!");
        }
    }

    menu_destroy(menu);
    return PLUGIN_HANDLED;
 }
Please.
spiN- 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 15:15.


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