Raised This Month: $ Target: $400
 0% 

Timed command for each round


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Metanabol
Member
Join Date: Feb 2009
Old 05-20-2009 , 17:01   Re: Timed command for each round
Reply With Quote #1

few steps:
1) add new bool variable
2) then catch start round event and start timer( set_task and start your function for specific time + set variable to true. ( to start menu for certain time )
3) then your function will set variable to false...


PHP Code:
public cmdWMenu(id)
{
   if(
variable) {
    if(
get_pcvar_num(gCvarMenuOpen) == 1)
        return 
PLUGIN_HANDLED
        
    
if(get_pcvar_num(gCvarMenuOpen) == 0)
    {
        
set_task(TASK_MENU_DISLPAY_TIME"choose_menu");
    }
}
else {
     
//client_print or etc...
}
    return 
PLUGIN_CONTINUE

im too drunk to write full code sry next time
Metanabol is offline
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 05-20-2009 , 18:41   Re: Timed command for each round
Reply With Quote #2

Quote:
Originally Posted by Metanabol View Post
few steps:
1) add new bool variable
2) then catch start round event and start timer( set_task and start your function for specific time + set variable to true. ( to start menu for certain time )
3) then your function will set variable to false...


PHP Code:
public cmdWMenu(id)
{
   if(
variable) {
    if(
get_pcvar_num(gCvarMenuOpen) == 1)
        return 
PLUGIN_HANDLED
        
    
if(get_pcvar_num(gCvarMenuOpen) == 0)
    {
        
set_task(TASK_MENU_DISLPAY_TIME"choose_menu");
    }
}
else {
     
//client_print or etc...
}
    return 
PLUGIN_CONTINUE

im too drunk to write full code sry next time
Well, i dont think i can understand this, can anyone help me get the right stuff (Pls comment, so i know where it is ^^ And set it right in the code
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
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 01:34.


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