12.08.2011, 20:54
pawn Код:
static
TeamCounts[ 2 ],
Team[ MAX_PLAYERS ]; // 2 Teams 0 - Red, 1 GREEN.
public OnPlayerRequestClass( playerid, classid )
{
if ( classid == 14 ) // For Example
{
TeamCounts[ 0 ]++; // In Red TM 1 player more!
Team[ playerid ] = 1; // Set Player Team In Variable.
// Now you can update TextDraw.
}
else
{
TeamCounts[ 0 ]++; // In Green TM 1 player more!
Team[ playerid ] = 2; // Set Player Team In Variable.
// Now you can update TextDraw.
}
return 1;
}
public OnPlayerDisconnect( playerid, reason )
{
if ( Team[ playerid ] == 1 )
TeamCounts[ 0 ]--;
else
TeamCounts[ 1 ]--;
// Subtract -1 now you can update TextDraw
return 1;
}