Help, please!
#1

Hey, guys!
This time I want to ask you about players and how show them when they connect. Well, for example player connects and choose team green and in the left of the screen shows for all players Green team players: (shows green team players) and little lower shows blue team players. Well, i hope you understand me. Sorry for my bad english, i'm Lithuanian! And thanks for all who helping me! In this site are very helpful people!
Reply
#2

At first you need to create TextDraw then you can make variable like:

pawn Код:
new TeamCount[2];
when player choose blue team add to variable ++

pawn Код:
TeamCount[0]++;
when green

pawn Код:
TeamCount[1]++;
And then you can update TextDraw this its very easy!

And sure! when player disconnected you need subtract -1 from variable = Update TextDraw.

Kapys?
Reply
#3

Not much. Can you give me an example?
Reply
#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


Forum Jump:


Users browsing this thread: 3 Guest(s)