Raised This Month: $ Target: $400
 0% 

Detect passed time


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Artick..
Junior Member
Join Date: Jul 2013
Old 07-22-2013 , 08:06   Detect passed time
Reply With Quote #1

Sorry for the title but I dind't find a good one.
1.How can I detect passed time from a vote ? I have a vote plugin. Let's say that I start a vote. How ca I verify the time passed and block a new vote for x minutes. This is: Now you start the vote,you can start it again after 20 minutes.
2.How can I make a menu/public to execute after a certain time ?
Artick.. is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 07-22-2013 , 10:42   Re: Detect passed time
Reply With Quote #2

1. Add this as a global variable:
Code:
new g_nextVote;
Add this at the start of a new vote.
Code:
if ( get_systime() < g_nextVote )      return;
Add this at the end of a new vote:
Code:
g_nextVote = get_systime() + 20 * 60; // 20 minutes á 60 seconds

2. Please explain further, I don't understand.

Last edited by Black Rose; 07-22-2013 at 11:10.
Black Rose is offline
akcaliberg
Senior Member
Join Date: Nov 2011
Location: Istanbul
Old 07-22-2013 , 10:49   Re: Detect passed time
Reply With Quote #3

1.

Code:
new gLastVoteTime; public VoteFunc(id) {     if(( get_systime() - gLastVoteTime ) < 1200) {         client_print(id,print_chat,"You must wait 20 minutes to start a new vote.")         return PLUGIN_HANDLED     }     // Vote functions         gLastVoteTime = get_systime(); }

2. certain time?

every X o'clock ?
every X minutes passed after the last vote ?
akcaliberg is offline
Artick..
Junior Member
Join Date: Jul 2013
Old 07-23-2013 , 10:01   Re: Detect passed time
Reply With Quote #4

2.Let's say that I have a menu. I want the menu to aotomatically appear in 3 rd round.
Artick.. is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 07-23-2013 , 10:16   Re: Detect passed time
Reply With Quote #5

PHP Code:
new count

public new_round( )
{
    
count++
}

public 
round_start( )
{    
    if( 
count == 3)
    {
        
// Your code here
    
}

__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
Shooting King
RAAASENGAN
Join Date: Mar 2012
Location: India
Old 07-23-2013 , 10:16   Re: Detect passed time
Reply With Quote #6

Use HLTV message to count round and if count == 3, show menu.
__________________
As every time said, don't ever UNDERESTIMATE me.

Donate - Here
Shooting King is offline
Old 07-23-2013, 10:17
Shooting King
This message has been deleted by Shooting King.
Reply


Thread Tools
Display Modes

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 06:22.


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