Raised This Month: $ Target: $400
 0% 

render and old menu questions


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 01-29-2010 , 14:45   render and old menu questions
Reply With Quote #1

hi,

for first, i'm not so good with old menu system, i want to add a item as EXIT item. so that my menu will not be closed after i choosed an item.
2. idk whats the problem but my set_user_rendering is not working. i tried to check if is user alive, but the same. happend nothing.
3. how to remove my task in FwdHamPlayerSpawnPost ?

full code :
__________________

Last edited by One; 01-29-2010 at 20:26.
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 01-29-2010 , 16:45   Re: render and old menu questions
Reply With Quote #2

1. You aren't using the old menu system. After they select a player, just show the player_menu again.

2. Try kRenderNormal instead of kRenderTransAlpha

3. Set the task with a taskid offset:
Code:
#define TASK_PLAYERFREE 1000

//...

set_task(0.5,"player_is_free",TASK_PLAYERFREE+id,"",0,"b")

//...

public player_is_free(id)
{
   id -= TASK_PLAYERFREE;
   //...
}

//...

//loop through players
remove_task(TASK_PLAYERFREE+id);
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`
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 01-29-2010 , 18:33   Re: render and old menu questions
Reply With Quote #3

ty. and how can i add an item in menu ?

i tried with :

Code:
public player_menu(id)
{
    
    new menu = menu_create("\yChoose the Free-Player", "free_choosed")
    new players[32], pnum
    new szName[32], szTempid[10]
    get_players(players, pnum)
    menu_additem(menu,"\wFreeday for all", "1", 0);
    for( new i; i<pnum;i++ )
    {
        
        tempid = players[i];
        if(get_user_team(tempid) == 1 && is_user_alive(tempid))
        {
            get_user_name(tempid, szName, 31)
            num_to_str(tempid, szTempid, 9)
            menu_additem(menu, szName, szTempid, 0)
        }
    }
    menu_display(id, menu, 0)
}
but idk how to case this in menu function?

Code:
public free_choosed(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)
    
    tempid = str_to_num(data)
    
    switch(tempid)
    {
        case 1:
        {
            client_print(0,print_chat,"Debug")
        }
        /// what now ? 
        case :
        {
            if( is_user_alive(tempid))
            {
               set_task(0.5,"player_is_free",TASK_PLAYERFREE+tempid,"",0,"b")
                player_menu(id)
            }
        }
    }
    menu_destroy(menu);
    return PLUGIN_HANDLED;
}
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 01-29-2010 , 18:39   Re: render and old menu questions
Reply With Quote #4

you'll probably want to use 0 (because it is not a player) and then instead of providing another case, use default:
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`
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 01-29-2010 , 18:43   Re: render and old menu questions
Reply With Quote #5

omg. ..... ty :-))) my bad
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-29-2010 , 18:55   Re: render and old menu questions
Reply With Quote #6

Quote:
Originally Posted by Emp` View Post
you'll probably want to use 0 (because it is not a player) and then instead of providing another case, use default:
I would probably use something like 99. I reserve 0 as a special number. But it doesn't really matter .
__________________
fysiks 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 07:23.


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