26.04.2010, 00:49
Quote:
|
Originally Posted by [TPG
Coole210 ]
im a little rusty but i think its like this: Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(isplayerconnected(i))
{
if(team[i] == team)
{
sendclientmessage(i,color,"You're teams' score is %s",getplayerscore(i));
}
}
}
|
pawn Код:
new
team1,
team2;
public OnPlayerConnect(playerid)
{
SetPVarInt(playerid, "Team", 1); // this is were you can set there team
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(Killerid != 255 && GetPVarInt(killerid,"Team") == 1) team1 ++, team2 --;
if(Killerid != 255 && GetPVarInt(killerid,"Team") == 2) team2 ++, team1 --;
return 1;
}
// then make a function to check the highest team
forward CheckTeams()
public CheckTeams()
{
if(team1 > team2) SendClientMessageToAll(color, "Team 1 Wins!");
if(team2 > team1) SendClientMessageToAll(color, "Team 2 Wins!!");
return 1;
}
// it can be as simple as this took me about 1 minutes to write this.

