SA-MP Forums Archive
TeamScore? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: TeamScore? (/showthread.php?tid=130244)



TeamScore? - -Rebel Son- - 25.02.2010

Im going to be making a -TDM- Script, but i want to make sure of a few things like, a code that checks all players and when a team gets (lets say 50) they win the round? Anyone have or know of a code to do this?

-Dakota.


Re: TeamScore? - Backwardsman97 - 26.02.2010

Under OnPlayerDeath, you would add a point or however many to their score right? Well, just do if the player's score equals 50, then end the game.

Example.
pawn Код:
public OnPlayerDeath(playerid,killerid,reason)
{
  if(killerid != 255)
  {
    SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
    if(GetPlayerScore(killerid)==50)
    {
       //End the game
    }
  }
  return 1;
}



Re: TeamScore? - -Rebel Son- - 26.02.2010

Thank-you sir for the code, it works.

-Dakota