Cubescript > curplayers
#2
[cubescript]numplayers = [
numpl = 0
loop npl 21 [
if (! (strcmp (findpn $npl) [])) [
// += numpl 1 // maybe += isn't in 1104?
numpl = (+ $numpl 1)
]
]
result $numpl
][/cubescript]

Might work, have not done anything like that in a while though, you'll have to test it.

Sometimes its better to know the highest valid client number though:

[cubescript]highestvalidcn = [
highestcn = -1
loop hvl 21 [
if (! (strcmp (findpn $hvl) [])) [
highestcn = $hvl
]
]
result $highestcn
][/cubescript]
Thanks given by:


Messages In This Thread
Cubescript > curplayers - by 888 - 21 Jan 13, 10:13PM
RE: Cubescript > curplayers - by Bukz - 21 Jan 13, 10:18PM
RE: Cubescript > curplayers - by 888 - 21 Jan 13, 10:25PM