AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Setting a round interval (https://forums.alliedmods.net/showthread.php?t=129740)

t3hNox 06-16-2010 10:09

Setting a round interval
 
Hi.
The title might be not very informative. What I want to do is as simple as setting a definite round interval before players are able to use *some* function. I use an bool for checking.

PHP Code:

#define RoundInterval 5
new bool:IntervalGood true
new iRoundInterval 0

public plugin_init( ) 
{
        
//...
    
register_logevent"EventRoundStart"2"1=Round_Start" );
}

public 
EventRoundStart( ) 
{
    if( !
IntervalGood && iRoundInterval <= RoundInterval ) {
        
iRoundInterval++ //It's increasing the integer value by 1, right?
    
}
    if( 
iRoundInterval RoundInterval ) {
        
iRoundInterval 0
        IntervalGood 
true
    
}
    return 
PLUGIN_HANDLED


For some reason it's not working properly. I don't know where is the problem.

tm. 06-16-2010 17:35

Re: Setting a round interval
 
You want every 5 rounds the players to have access to some functions, right? It might be the fact that you set IntervalGood as true when you create it. By default booleans are set to false, you should let it that way.


All times are GMT -4. The time now is 14:44.

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