Raised This Month: $ Target: $400
 0% 

random pick from menu?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
liryck
Senior Member
Join Date: Mar 2007
Location: Venezuela
Old 03-16-2010 , 13:26   random pick from menu?
Reply With Quote #1

hi there again. i make a menu, this menu is for chosse players, i already have the menu charged with the players and already display it randomly to some one.

the menu is working 100% but sometimes the player that should choose is afk. so is there a form that for example.

the menu display to me but im afk so 10 segs or X segs latter is there is no choose pick an option randomly.

i try making a funtion called random_choose, and X seconds latter i called if a bool is true the think is that i got the random player but well can't close the menu as i see can't use 2 functions for 1 menu
liryck is offline
Send a message via MSN to liryck
AzcariaX
Junior Member
Join Date: Jun 2009
Location: Sweden
Old 03-17-2010 , 17:59   Re: random pick from menu?
Reply With Quote #2

If i've understand correctly. You want to close the menu on the player who AFK?

Then this should work, I think.
PHP Code:

client_cmd
(afkplayer"slot10"
AzcariaX is offline
liryck
Senior Member
Join Date: Mar 2007
Location: Venezuela
Old 03-18-2010 , 00:31   Re: random pick from menu?
Reply With Quote #3

uhm lets see this is my test func, i call with a command my menu normally menu display all okay at there, when the menu display im setting a task for this random_choose of 10 segs. so i wait the 10 segs i got that random player was choosen but the menu still displaying to me, i want to close it

PHP Code:
public random_choose(id)
 {
     new 
player
     
new ran;
    new 
name[32]
     new 
selected[32]
    new 
count
     
if(rand == true)
    {
        
        
ran random(iNum);
        
selected[count++] = iPlayers[ran];
        
iPlayers[ran] = iPlayers[--iNum];
        
player iPlayers[ran];    
        
check true;
        
        if(
swap == false)
        {
            
cs_set_user_team(playerCS_TEAM_CT)
            
get_user_name(player,name,31)
            
client_print(0,print_chat,"%s Has Sido Elegido Por el Capitan de los CT's",name)
            
            
swap true
            client_cmd
(id"slot10"
            
//set_task(5.0,"AwesomeMenu",id)
            
return PLUGIN_HANDLED;
        }
        if(
swap == true)
        {
            
cs_set_user_team(playerCS_TEAM_T)
            
get_user_name(player,name,31)
            
client_print(0,print_chat,"%s Has Sido Elegido Por el Capitan de los T's",name)
            
swap false
                        
            
            client_cmd
(id"slot10"
            
//set_task(5.0,"AwesomeMenu",id)
            
return PLUGIN_HANDLED;
        }
        
    }

liryck is offline
Send a message via MSN to liryck
AzcariaX
Junior Member
Join Date: Jun 2009
Location: Sweden
Old 03-18-2010 , 09:50   Re: random pick from menu?
Reply With Quote #4

Post full code please.
AzcariaX 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:37.


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