Raised This Month: $ Target: $400
 0% 

menu and random choose


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
liryck
Senior Member
Join Date: Mar 2007
Location: Venezuela
Old 03-10-2010 , 23:22   menu and random choose
Reply With Quote #1

hi there i want to know all know that if a menu appear and the player is afk latter of sometime menu gone right? well if that happend how i know that?

i mean if the player with menu dont choose any option

data = 0? or something?
liryck is offline
Send a message via MSN to liryck
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-10-2010 , 23:56   Re: menu and random choose
Reply With Quote #2

When the menu is displayed, set bool to false. When\if he selects something, set it to true.

PHP Code:
new g_bSelectedMenu;
#define CheckFlag(%1)    (g_bSelectedMenu & (1<<(%1 & 31 )))
#define SetFlag(%1)    (g_bSelectedMenu |= (1<<(%1 & 31 )))
#define RemFlag(%1)    (g_bSelectedMenu &= ~(1<<(%1 & 31 ))) 
To set the bool to false:
PHP Code:
//Set all players bool to false
g_bSelectedMenu 0;

//Set single player bool to false
RemFlagid ); 
To set the bool to true:
PHP Code:
SetFlagid ); 
Check if the bool is true:
PHP Code:
CheckFlagid ); 
__________________

Last edited by Bugsy; 03-11-2010 at 00:03.
Bugsy is offline
liryck
Senior Member
Join Date: Mar 2007
Location: Venezuela
Old 03-11-2010 , 11:41   Re: menu and random choose
Reply With Quote #3

ok i understand i bit about the bool but you'r using something that i dont understand here is an code.

how it should be done?

PHP Code:
public menu_handler(idmenuitem)
 {
 new 
selectedct[32]
 new 
count
 
new ct_team;
 new 
flag 0;
 new 
t_team;
 new 
name[32]
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }

    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);

    
//Get the id of the player that was selected
    
server_print"playerid = %s" data ); 
    new 
ptempid str_to_num(data);
     
server_print"playerid = %d" ptempid ); 
    
    
       if (
swap false && is_user_connected(ptempid))
    {
            
cs_set_user_team(ptempidCS_TEAM_CT)
            
get_user_name(ptempid,name,31)
            
client_print(0,print_chat,"%s Has Sido Elegido Por el Capitan de los CT's",name)
            
GetPlayerIndex(ptempid)
            
swap true
        
                menu_destroy
(menu);
                
set_task(5.0,"AwesomeMenu",id)
                return 
PLUGIN_HANDLED;
    }
    if(
swap true && is_user_connected(ptempid))
       {
            
cs_set_user_team(ptempidCS_TEAM_T)
            
get_user_name(ptempid,name,31)
            
client_print(0,print_chat,"%s Has Sido Elegido Por el Capitan de los CT's",name)
            
GetPlayerIndex(ptempid)
            
swap false
                        
                menu_destroy
(menu);
                
set_task(5.0,"AwesomeMenu",id)
                return 
PLUGIN_HANDLED;
      }
 
    if(
iNum == 0){
        
client_print(0,print_chat,"No Hay Mas Players")
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
 } 
liryck is offline
Send a message via MSN to liryck
liryck
Senior Member
Join Date: Mar 2007
Location: Venezuela
Old 03-12-2010 , 11:49   Re: menu and random choose
Reply With Quote #4

k epic fail couldn't get it
liryck is offline
Send a message via MSN to liryck
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-12-2010 , 13:58   Re: menu and random choose
Reply With Quote #5

explain exactly what you dont understand or cant do.
__________________
Bugsy is offline
liryck
Senior Member
Join Date: Mar 2007
Location: Venezuela
Old 03-12-2010 , 20:05   Re: menu and random choose
Reply With Quote #6

for example Bugsy got the Captaing for the CT team and I got the Captain For T Team.

so a menu display to you first but you're AFK, so X Segs pass andthe menu leave ur screen so no player for your team was selected CT team. if that happend i want that a random player from the list go to CT. caus the CT cap is afk and no player was selected .

i dont know if u got my point
liryck is offline
Send a message via MSN to liryck
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 03-12-2010 , 21:20   Re: menu and random choose
Reply With Quote #7

Sorry for the off-topic, but what exactly are you making? It seems you and flamin are both having issues concurring within a week, both of them being the same. It sounds like it'd make everyone's lives easier if myself or someone else just made whatever you two and all the others are making.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
liryck
Senior Member
Join Date: Mar 2007
Location: Venezuela
Old 03-12-2010 , 22:27   Re: menu and random choose
Reply With Quote #8

im just trying to add a captain sorted mode to the YAP plugin that was made. that's all.

i already change many thing to it from myself and the help of this forum & ppl.

i already got that my menus works just that don't know how to make what i already ask in my last post
liryck is offline
Send a message via MSN to liryck
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-12-2010 , 22:29   Re: menu and random choose
Reply With Quote #9

Quote:
Originally Posted by liryck View Post
im just trying to add a captain sorted mode to the YAP plugin that was made. that's all.

i already change many thing to it from myself and the help of this forum & ppl.

i already got that my menus works just that don't know how to make what i already ask in my last post
Post or pm me your entire plugin.
__________________
Bugsy 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 08:44.


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