AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   menu destroy (https://forums.alliedmods.net/showthread.php?t=147085)

Tonda 01-05-2011 08:18

menu destroy
 
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)
 }
}


Elusive138 01-05-2011 09:07

Re: menu destroy
 
A good start would be to name your function something other than menu_destroy..

MyDooMJr 01-05-2011 09:36

Re: menu destroy
 
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 :)

fysiks 01-05-2011 20:06

Re: menu destroy
 
menu_destroy will NOT remove it from your screen. It disables it's function and releases the memory resource.

Emp` 01-05-2011 21:45

Re: menu destroy
 
To hide a menu, you should use:
Code:

show_menu(id, 0, "^n", 1);

Kreation 01-05-2011 22:08

Re: menu destroy
 
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. }


All times are GMT -4. The time now is 02:10.

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