How to make this.
#1

How can i make something like.. If Team 1 has more points than Team 2, Team 1 will win.

Example:

Team 1: 302
Team 2: 136

Team 1 wins because it has more points
Reply
#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
#3

This might work ^^. Going to test it soon. will reply if it works.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)