How to make this.
#2

ok i hope this helps a bit if you have any questions just pm me or reply here

Код:
// abovemain with global vars

#define GAMETIME   10//this munber is in minuites NOT miliseconds

new Team1Kills;//these count +1 per kill
new Team2Kills;//these count +1 per kill

//inside OnGamemodeInit
SetTimer("EndGame",GAMETIME*1000,0);//this is a timer that you might already have to end the gamemode

//inside OnPlayerDeath
if(gTeam[killerid] == TEAM_1)
{
  Team1Kills++;//counting kills for team 1
}
if(gTeam[killerid] == TEAM_2)
{
  Team2Kills++;//counting kills for team 2
}

forward EndGame();
public EndGame()//end of the game messages to inform player it is over
{
  if(Team1Kills > Team2Kills)
  {
    GameTextForAll("~g~~h~Team 1 Wins!",5000,5);
        for(new i = 0; i <MAX_PLAYERS; i++)
		{
          if(gTeam[i] == TEAM_1)
          {
		     GivePlayerMoney(playerid,<whatever_you_want_here>);
          }
		}
    
  }
  else if(Team2Kills > Team1Kills)
  {
     GameTextForAll("~g~~h~Team 1 Wins!",5000,5);
        for(new i = 0; i <MAX_PLAYERS; i++)
		{
          if(gTeam[i] == TEAM_2)
          {
		     GivePlayerMoney(playerid,<whatever_you_want_here>);
          }
		}
  }
  SetTimer("Goodbye"3000,0);
}

forward GoodBye();
public GoodBye()
{
  GamemodeExit();//exit the gamemode
}
happy scripting /phil
Reply


Messages In This Thread
How to make this. - by ~Dangun! - 27.01.2010, 14:48
Re: How to make this. - by philmckrakin - 27.01.2010, 15:28
Re: How to make this. - by ~Dangun! - 27.01.2010, 15:44

Forum Jump:


Users browsing this thread: 1 Guest(s)