If activeClients

15 replies [Last post]
(*WASP*SH▲DOWKNIGHT)
Site administrator
haxxus's picture
Offline
Joined: May 2007
Posts:
US United States

Hello all , a little question just before the world ends . Happy .

( The .cfg rotation is attached )

Yesterday i had it with 'if' only , no 'else if' and 'else' and only the >=1 maps worked and when i had 5 players in to test still only the >=1 maps rotated , so now i added the else if and else.
Do you think it will work ? do you see something wrong ? .

Login or register to view attached files

epsiplayer
THE ONE AND ONLY
intact-epsilon's picture
Offline
Joined: Dec 2006
Posts:
Re: If activeClients

I don't see the "else if".

How you write it now, if the activeClients() returns 5 this is how the rotation will be considerd:

        somemap1
        somemap2
        somemap3 {
        $timelimit = 5;
                $fraglimit = 20;
                $g_gametype = GT_FFA;
                $xp_config = "test";
    }
        somemap4
        somemap5
        somemap6 {
        $timelimit = 8;
                $fraglimit = 30;
                $g_gametype = GT_FFA;
                $xp_config = "test";
    }

why? very simple: because 5 >= 1 and 5> 4
To be good, it should have
if ( activeClients() >= 1 ) {
        .... 
} else if ( activeClients() > 4 ) {
        ....
} else if ( activeClients() > 8 ) {
        ....
}

Ahh... and you should to use: xp_activeClients

Quote:
xp_activeClients:
Informative cvar that holds the number of non-spectators players that
are currently in the server. Very useful for writing conditional
rotations, see the Rotation System documentation for further information.

if ( xp_activeClients >= 12 ) {
    // big maps, 12 clients or more
    q3dm12
    q3dm14
    q3dm15
} else if ( xp_activeClients >= 6 ) {
    // normal maps, from 6 to 11 clients
    q3dm6
    q3dm7
    q3dm8
} else {
    // small maps, 5 clients or less
    q3dm2
    q3dm3
    q3dm5
}

See in the documentation : http://www.excessiveplus.net/documentation/server/rotation-system

_________
eps!slow


3m'genesis
G3n3sis's picture
Offline
Joined: Apr 2011
Posts:
Re: If activeClients

i dont see the return ...

epsiplayer
THE ONE AND ONLY
intact-epsilon's picture
Offline
Joined: Dec 2006
Posts:
Re: If activeClients

Executed functions returns values, that's what i've meant.
___________
epsislow


(*WASP*SH▲DOWKNIGHT)
Site administrator
haxxus's picture
Offline
Joined: May 2007
Posts:
US United States
Re: If activeClients

this is good then ? ;

BOZO
Bozo's picture
Offline
Joined: Feb 2010
Posts:
Re: If activeClients
(*WASP*SH▲DOWKNIGHT) wrote:

this is good then ? ;

Yeah looks good. Smug

3m'genesis
G3n3sis's picture
Offline
Joined: Apr 2011
Posts:
Re: If activeClients
epsiplayer wrote:

Executed functions returns values, that's what i've meant.
___________
epsislow

i know what u've said , but it must be an return () ... to return values otherwise it's not an avaiable function .

3m'genesis
G3n3sis's picture
Offline
Joined: Apr 2011
Posts:
Re: If activeClients

$xp_config = "qlinsta"; ...... ====> "qlinsta.cfg"

(*WASP*SH▲DOWKNIGHT)
Site administrator
haxxus's picture
Offline
Joined: May 2007
Posts:
US United States
Re: If activeClients

im getting this error;
Rcon: rotateWARNING: accessing unknown <Attribute> 'xp_activeClients' in rotation.txt on line 44 column 28 Near: ) { // big maps, 8 clients or moWARNING: accessing unknown <Attribute> 'xp_activeClients' in rotation.txt on line 54 column 35 Near: ) { // normal maps, from 4 to 7

epsiplayer
THE ONE AND ONLY
intact-epsilon's picture
Offline
Joined: Dec 2006
Posts:
Re: If activeClients

Hmm, I think now that you were right with activeClients(),
because i've found out that the new version's is actually activeClients() :

easy wrote:
Note that xp_activeClients now is a function and should become activeClients().

So try to replace xp_activeClients with activeClients() (sorry)

GL & HF
__________
epsislow


BOZO
Bozo's picture
Offline
Joined: Feb 2010
Posts:
Re: If activeClients
epsiplayer wrote:

that the new version's is actually activeClients()

Good 1 Epsi!