AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Determine how many players are in the server? (https://forums.alliedmods.net/showthread.php?t=22114)

TheNinthPlayer 12-19-2005 00:43

Determine how many players are in the server?
 
Is thier a way to determine how many people are currently connected to the server? and if so is their a way to tell how many are bots and how many are real?

At the moment I am relying on my script to keep count of the users in a variable but my client_disconnect and client_connect fuction arn't always being called on conncects and disconnects. So the count gets screwed up.

XxAvalanchexX 12-19-2005 03:47

For your everyday player count (regular players and bots), use get_playersnum.

If you want to get bot count, you'd have to do something like this:

Code:
new players[32], num;  get_players(players, num, "d");  // "num" now contains number of bots in server

The "d" flag skips real players (more info).

You could alternatively use the "c" flag to skip bots and get a count of regular players in the server.


All times are GMT -4. The time now is 15:56.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.