[SELECT ALL] Code:
// Client counting ident script by DES|Bukz
alias curplayers [
players = 0
if (= $connected 1) [
loop x 21 [
if (= (at (pstat_score $x) 4) -1) [] [
+= players 1
]
]
result $players
] [result -1]
]
docsection [Server]
docident [curplayers] [Returns the current number of clients on the server.]
docremark [If executed while not connected to a server, it will return -1]
docexample [/echo (curplayers)] [Output: 6]
A new homemade ident that returns the current number of clients (players) on the server. This return is done silently as almost all cubescript idents, therefore an echo is required to *see* it's result. But, it will still work within any scripts you may incorporate it into. :)
Note: It requires no arguments.