10.07.2011, 04:50
How would i do team score, then the server restarts (newround) when the team gets 50 Score?
new TeamScore;
//Use this to add to the team's score - "TeamScore += 1;"
if(TeamScore >= 50) //If team's score is 50 or greater
{
SendRconCommand("gmx"); //restart the server
return 1;
}
#include <a_samp>
#define TEAM_BLUE 0
#define TEAM_RED 1
new TeamBlueScore;
new TeamReadScore;
new CheckScoreTimer;
forward ScoreCheck();
public OnFilterScriptInit()
{
TeamBlueScore = 0;
TeamReadScore = 0;
CheckScoreTimer = SetTimer("ScoreCheck", 1000 * 5, 1);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(GetPlayerTeam(killerid) == TEAM_BLUE)
{
TeamBlueScore ++;
}
if(GetPlayerTeam(killerid) == TEAM_RED)
{
TeamReadScore ++;
}
return 1;
}
public ScoreCheck()
{
if(TeamBlueScore > 25)
{
GameTextForAll("~w~Team ~b~Blue ~w~Wins", 2500, 4);
return 1;
}
else if(TeamReadScore > 25)
{
GameTextForAll("~w~Team ~r~Read ~w~Wins", 2500, 4);
return 1;
}
SendRconCommand("gmx");
KillTimer(CheckScoreTimer);
return 1;
}