Raised This Month: $ Target: $400
 0% 

menu_destroy


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
reinert
Veteran Member
Join Date: Feb 2007
Old 09-21-2011 , 11:27   menu_destroy
Reply With Quote #1

How to destroy menu correctly, because right now the menu is still seen by players, but if they choose something, nothing happens and menu disappears. I want the menu to disappear after 10seconds.

I've got this:
PHP Code:
new menu
PHP Code:
set_task(10.0"DestroyMenu"id 672
PHP Code:
public DestroyMenu(id)
{
    
menu_destroy(menu)

Can't destroy it via player cmd like this:

client_cmd(id, "slot10"), because I've disabled EXIT option in menu
reinert is offline
r0ck
Senior Member
Join Date: Jun 2011
Location: India
Old 09-21-2011 , 11:33   Re: menu_destroy
Reply With Quote #2

menu_cancel(id)
__________________
Preparing to release my plugins..
r0ck is offline
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 09-21-2011 , 11:38   Re: menu_destroy
Reply With Quote #3

Note that if you set id parameter in set_task to id + 672, and then just directly use the taskid in the called function; it will throw an error.

Done correctly:
Code:
set_task( 10.0, "Function", id + 672 ); public Function( taskid ) {     new id = taskid - 672;     // use id for the client }
__________________
Achievements API - a simple way for you to create your OWN custom achievements!
Xellath is offline
r0ck
Senior Member
Join Date: Jun 2011
Location: India
Old 09-21-2011 , 11:47   Re: menu_destroy
Reply With Quote #4

Full Complete Code
PHP Code:
set_task(10.0"DestroyMenu"id 672

public 
DestroyMenu(id)
{
    
id -= 672
    menu_cancel
(id)

__________________
Preparing to release my plugins..
r0ck is offline
Old 09-21-2011, 11:52
Stereo
This message has been deleted by Stereo. Reason: unnecesary
Korxu
Senior Member
Join Date: Sep 2010
Old 09-21-2011 , 11:54   Re: menu_destroy
Reply With Quote #5

It's the same... He removes 642 from the index, and the result is the player index.
Korxu is offline
Stereo
Veteran Member
Join Date: Dec 2010
Old 09-21-2011 , 11:56   Re: menu_destroy
Reply With Quote #6

It's true xd

to close menu:


PHP Code:
show_menu(id0"^n"1
Stereo is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-21-2011 , 12:16   Re: menu_destroy
Reply With Quote #7

You have to destroy the menu, aka clear memory.
Clean player hud is another thing.

Without your code, it's hard to guess where to add what...
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 09-21-2011 , 12:19   Re: menu_destroy
Reply With Quote #8

Well I think I already fixed it.
reinert is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-21-2011 , 18:00   Re: menu_destroy
Reply With Quote #9

You need to read the ENTIRE tutorial (or at least be smart about what sections you do read).
__________________
fysiks is offline
Old 11-04-2011, 10:21
bloodrage_16
This message has been deleted by Emp`. Reason: Irrelevant
Old 11-04-2011, 11:59
MyPc
This message has been deleted by Emp`. Reason: Reply to deleted post
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 19:41.


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