View Single Post
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 02-20-2017 , 13:33   Re: menu for x secondes
Reply With Quote #24

Or ..
PHP Code:
#if defined _menutime_included
    #endinput
#endif

#define _menutime_included

new task_id;

stock menu_set_timeout( const id, const iMenu, const fTime )
{
    
task_id random_num(110000)

    new 
iTask id task_id;
    
remove_taskiTask );

    new 
iRemoveMenu];
    
iRemoveMenu] = iMenu;

    
set_taskfloatfTime ), "RemoveMenu"iTaskiRemoveMenusizeof iRemoveMenu );
}

public 
RemoveMenuiRemoveMenu], iPlayer )
{
    
iPlayer -= task_id
    
new iMenuiNewMenu;    
    if ( 
player_menu_infoiPlayeriMenuiNewMenu ) )
    {
        if ( 
iNewMenu == iRemoveMenu] )
            
show_menuiPlayer0"^n");
    }

Easier to pick the time and tasks won't be messed up (1 in 1 million chances but still one might have the same task id as the one you specified)
__________________

Last edited by edon1337; 02-20-2017 at 13:34.
edon1337 is offline