09.07.2011, 23:12
You're on the right track but instead of updating the string on OnPlayerConnect, update it on OnPlayerDeath.
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
if(GetPlayerTeam(killerid) == 1)
{
team1score++; //Sets team1score
new newtext[41];
GetPlayerScore(playerid, team1score);
format(newtext, sizeof(newtext), "BLUE: %d", team1score);
TextDrawSetString(textdrawblue, newtext);
}
if(GetPlayerTeam(killerid) == 2)
{
team2score++; //Sets team2score
new newtext[41];
format(newtext, sizeof(newtext), "Red: %d", team2score);
TextDrawSetString(textdrawred, newtext);
}
if(team1score == 100 || team2score == 100)
{
SendRconCommand("gmx"); //Restarts Server
}
return 1;
}