Bombing Countdowns
#2

pawn Код:
//global
new
  timer1 = 7,
  timer2 = 30,
  gBombTimer1,
  gBombTimer2;

forward BombTimer1(playerid);
forward BombTimer2(playerid);

//wherever you want the countdown
gBombTimer1 = SetTimerEx( "BombTimer1", 1000, true, "i", playerid );
pawn Код:
//first timer
public BombTimer1(playerid)
{
  while( timer1 > 0 )
    timer1--;
  if( timer1 == 0 )
  {
    SetTimer( "BombTimer2", 1000, true );
    KillTimer( gBombTimer1 );
  }
  new
    szTimer[ 128 ];
  format( szTimer, sizeof( szTimer ), "%d secs left", timer1 );
  SendClientMessage( playerid, 0xFFFFFFFF, szTimer );
  return true;
}
pawn Код:
//second timer
public BombTimer1(playerid)
{
  while( timer2 > 0 )
    timer2--;
  if( timer2 == 0 )
  {
    //Here is where you add explosions and stuff
    KillTimer( gBombTimer2 );
  }
  new
    szTimer[ 128 ];
  format( szTimer, sizeof( szTimer ), "%d secs left", timer2 );
  SendClientMessage( playerid, 0xFFFFFFFF, szTimer );
  return true;
}
I hope this works out for you, good luck!
Reply


Messages In This Thread
Bombing Countdowns - by Tigerbeast11 - 14.12.2009, 19:32
Re: Bombing Countdowns - by LarzI - 14.12.2009, 19:43
Re: Bombing Countdowns - by Tigerbeast11 - 14.12.2009, 19:46
Re: Bombing Countdowns - by LarzI - 14.12.2009, 19:48
Re: Bombing Countdowns - by Tigerbeast11 - 14.12.2009, 19:50
Re: Bombing Countdowns - by LarzI - 14.12.2009, 19:51
Re: Bombing Countdowns - by Tigerbeast11 - 14.12.2009, 19:51
Re: Bombing Countdowns - by LarzI - 14.12.2009, 19:54
Re: Bombing Countdowns - by Tigerbeast11 - 14.12.2009, 19:58
Re: Bombing Countdowns - by LarzI - 14.12.2009, 20:02

Forum Jump:


Users browsing this thread: 1 Guest(s)