How do i get the score of everybody in one team?
#3

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));
}
}
}
this has nothing to do with his question that looks like a a send team message function or something, also you would have to make something like

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.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)