Raised This Month: $ Target: $400
 0% 

One menu blocks other to show up!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
spiN-
Member
Join Date: Jul 2008
Location: Lithuania
Old 08-23-2009 , 12:21   One menu blocks other to show up!
Reply With Quote #1

Hello. I have created a menu that pops-up at round start with some good stuff in it, but there is a problem... I want to use it with Zombie Plague mod and when the round starts the mods gun menu blocks my created menu to show up... So, is there a way to do a menu that will pop-up after some time or when the ZP gun menu will be closed?

P.S. If there are a topic with answer, please post a link. Thank you!
spiN- is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 08-23-2009 , 12:50   Re: One menu blocks other to show up!
Reply With Quote #2

http://www.amxmodx.org/funcwiki.php?go=func&id=280
I think that this does the trick. Using it in conjunction with a loop set_task will do the trick.
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
spiN-
Member
Join Date: Jul 2008
Location: Lithuania
Old 08-23-2009 , 13:27   Re: One menu blocks other to show up!
Reply With Quote #3

Can you (or some1 else) give me an example with that? Because I'm not good at scripting and I can't understand how to put it in my menu... This is my first time I have this problem.
spiN- is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 08-23-2009 , 13:57   Re: One menu blocks other to show up!
Reply With Quote #4

Before you show the menu use the function that I have stated above.
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
spiN-
Member
Join Date: Jul 2008
Location: Lithuania
Old 08-23-2009 , 16:39   Re: One menu blocks other to show up!
Reply With Quote #5

Thanks for your reply.

I puted this in my code:
Code:
public menu_keys() {
    new menu,keys
 
    for(new o=1;o<33;o++) {
        get_user_menu(o, menu, keys)
    }
it compiles fine, but menu still disappears... What I'm doing wrong?
spiN- is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 08-23-2009 , 21:22   Re: One menu blocks other to show up!
Reply With Quote #6

I think you should use get_maxplayers() instead of "33" in your loop.
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
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
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 08-24-2009 , 10:59   Re: One menu blocks other to show up!
Reply With Quote #8

using tasks i think: http://www.amxmodx.org/funcwiki.php?go=func&id=253
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
spiN-
Member
Join Date: Jul 2008
Location: Lithuania
Old 08-24-2009 , 11:49   Re: One menu blocks other to show up!
Reply With Quote #9

Code:
new args[1];
public example(id)
{
args[0] = id;
set_task(15.0,"Player_Spawn",0,args,1,"c",0);
}
Will this work and am I correct with my code above? Will it show the menu after 15 seconds and will it be showen after every player spawn?
spiN- is offline
spiN-
Member
Join Date: Jul 2008
Location: Lithuania
Old 08-24-2009 , 16:51   Re: One menu blocks other to show up!
Reply With Quote #10

SOLVED with that menu show up!

Now I have other problems with menu...

1th - When some one chooses from menu Extra Speed, they don't get it... This is how looks speed code:
PHP Code:
public ev_CurWeapon(id)
{
    if(
g_iSpeedy[id])
    {
        new 
iCheckWeapon read_data(2)
        if(
iCheckWeapon != g_iCheckWeapon[id])
        {
            
g_iCheckWeapon[id] = iCheckWeapon
            
new Float:fMaxSpeed get_user_maxspeed(id)
            if(
fMaxSpeed 450.0)
            {
                
set_user_maxspeed(id450.0)
            }
        }
    }

and:
PHP Code:
case 3
        { 
            
set_user_maxspeed(id 450.0);
            
client_print(idprint_center "Your speed increased!");
            
g_iSpeedy[id] = true 
        

Why this isn't working?!

2nd - How to make, that only CT's can choose weapon from menu?

P.S. Sorry for double-post.

Last edited by spiN-; 08-24-2009 at 16:54.
spiN- 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 15:15.


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