Help, please!
#4

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;
}
Sorry for spacing, this its my style.
Reply


Messages In This Thread
Help, please! - by Setkus - 12.08.2011, 20:01
Re: Help, please! - by Raimis_R - 12.08.2011, 20:21
Re: Help, please! - by Setkus - 12.08.2011, 20:39
Re: Help, please! - by Raimis_R - 12.08.2011, 20:54

Forum Jump:


Users browsing this thread: 2 Guest(s)