19.07.2011, 08:12
....edit for your needs is not very good because i don't know your code so.. i have do my best...
pawn Код:
#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;
}