Raised This Month: $ Target: $400
 0% 

menu destroy


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Tonda
Senior Member
Join Date: Aug 2009
Old 01-05-2011 , 08:18   menu destroy
Reply With Quote #1

hi all, i need help. this script remove menu from all CT players if i say /menudestroy but dont work, where is wrong?

Code:
public menu_destroy (id, menu)
{
 if( is_user_alive( id ) && cs_get_user_team( id ) == CS_TEAM_CT )
 {
 menu_destroy(menu)
 } 
}
Tonda is offline
Elusive138
Senior Member
Join Date: Dec 2010
Old 01-05-2011 , 09:07   Re: menu destroy
Reply With Quote #2

A good start would be to name your function something other than menu_destroy..
Elusive138 is offline
MyDooMJr
Member
Join Date: Jun 2009
Location: Portugal
Old 01-05-2011 , 09:36   Re: menu destroy
Reply With Quote #3

Humm,

First : If you don't want the menu to be displayed for TEAM_CT, you may add that code on menu function :

Example :

Code:
public tonda(id)
{
    
    new menu = menu_create("\rMenu","menu_tonda")
    
    if( is_user_alive( id ) && cs_get_user_team ( id ) == CS_TEAM_CT )
    {
        menu_destroy(menu)
    }
  // menu_additem(menu,"Tonda Shop's","1",0)
}
U should use AMXX New Menu Style , if you're not using it.

http://forums.alliedmods.net/showthread.php?t=46364 <-- New amx menu style.

Regards

I hope i helped you

Last edited by MyDooMJr; 01-05-2011 at 09:39.
MyDooMJr is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-05-2011 , 20:06   Re: menu destroy
Reply With Quote #4

menu_destroy will NOT remove it from your screen. It disables it's function and releases the memory resource.
__________________
fysiks is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 01-05-2011 , 21:45   Re: menu destroy
Reply With Quote #5

To hide a menu, you should use:
Code:
show_menu(id, 0, "^n", 1);
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Kreation
Veteran Member
Join Date: Jan 2010
Location: Illinois
Old 01-05-2011 , 22:08   Re: menu destroy
Reply With Quote #6

Or if you don't want CT's to see it you can do this rather than what MyDoom posted:

Code:
if( cs_get_user_team( id ) != CS_TEAM_CT ) {     menu_display( id, menu, 0 ); // this might be wrong, i dont remember EDIT: it is. fixed it. }
__________________
Hi.
Kreation 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 02:10.


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