No. Of Players In Textdraw
#1

How To get The Number Of Online Players In Textdraw...?
Reply
#2

Using foreach would be:
pawn Код:
Iter_Count(Player)
If not, then loop and count:
pawn Код:
stock CountPlayers( )
{
    new
        count
    ;
   
    for( new i; i != MAX_PLAYERS; i++ ) if( IsPlayerConnected( i ) && !IsPlayerNPC( i ) ) count++;

    return count;
}
Reply
#3

https://sampforum.blast.hk/showthread.php?tid=168818
Use search button before Posting a Thread.
Reply
#4

i Dont Clearly UnderStand......
Reply
#5

Quote:
Originally Posted by AryanV
Посмотреть сообщение
i Dont Clearly UnderStand......
To the place you want to change the online players in the textdraw (either timer or OnPlayerConnect/OnPlayerDisconnect - depending on what you're using) format a string and pass as argument:

either
pawn Код:
Iter_Count(Player)
If you're using foreach

or
pawn Код:
CountPlayers( )
if you're not using foreach.

Then set the new string to the textdraw

Note: If you're not using foreach, don't forget to add the stock at the bottom.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)