timers
#1

Hello guys i want to make a code that every 5 min there will be explosions for 1 min and then explosions stop after one minute is done.

i have did this so far

PHP код:
public OnGameModeInit()
{
    
SetTimer("bombtime"3000001);
    return 
1;
}
public 
bombtime()
{
    
SetTimer("OneMinBomb"600001);
     return 
1;

Reply
#2

Try with it - http://pastebin.com/X36CqKZq
Reply
#3

can you explain the code for me please
Reply
#4

First what you're going to do is create a global timer which is started every 1 second.
On top of your gamemode you're creating a new variable which is a value for check "if" in timer.
after 60 seconds explosions you're waiting (5 minutes) for get 360 (5 minutes + 1 minute explosions) value from variable GlobalSec and then set the value to 0.

There's pastebin with comments - http://pastebin.com/zxXz6RKZ
Reply
#5

thanks man the code worked
Reply
#6

i have problem the explosion not repeating after passed 5 minutes since last explosion
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)