diff --git a/config/compatibility.cfg b/config/compatibility.cfg index ae9b1faa..76c03d93 100644 --- a/config/compatibility.cfg +++ b/config/compatibility.cfg @@ -1,12 +1,15 @@ // Makes old cubescripts compatible with newer versions of the game -const curmode [ result $gamemode ] +const alive [ if (&& $numargs (isclient $arg1)) [ result (player $arg1 alive) ] [ result (player1 alive) ] ] +const currole [ if (&& $numargs (isclient $arg1)) [ result (player $arg1 role) ] [ result (player1 role) ] ] +const curmode [ result $gamemode ] const getclientmode [ result $gamemode ] - -const curteam [ if (&& $numargs (isclient $arg1)) [ result (player $arg1 team) ] [ result (player1 team) ] ] +const curteam [ if (&& $numargs (isclient $arg1)) [ result (player $arg1 team) ] [ result (player1 team) ] ] +const findpn [ if (isclient $arg1) [ result (player $arg1 name) ] [ result "" ] ] +const isSpect [ if (&& $numargs (isclient $arg1)) [ result (player $arg1 spect) ] [ result (player1 spect) ] ] const pstat_score [ if (isclient $arg1) [ - result (concat (player $arg1 flags) (player $arg1 frags) (player $arg1 deaths) (player $arg1 points) (player $arg1 team) (player $arg1 tks) (findpn $arg1)) + result (concat (player $arg1 flags) (player $arg1 frags) (player $arg1 deaths) (player $arg1 points) (player $arg1 team) (player $arg1 tks) (player $arg1 name)) ] [ result (concat "0 0 0 0 -1 0" (addpunct)) ] ] \ No newline at end of file diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index 14b3391e..3ebe7f5c 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -265,8 +265,8 @@ COMMANDN(team, newteam, ARG_1STR); COMMANDN(name, newname, ARG_1STR); COMMAND(benchme, ARG_NONE); ICOMMANDF(isclient, ARG_1EXP, (int cn) { return getclient(cn) != NULL ? 1 : 0; } ); -ICOMMANDF(isSpect, ARG_IVAL, (void) { return (player1->team==TEAM_SPECT || player1->spectatemode==SM_FLY); }); -ICOMMANDF(currole, ARG_IVAL, (void) { return player1->clientrole; }); +//ICOMMANDF(isSpect, ARG_IVAL, (void) { return (player1->team==TEAM_SPECT || player1->spectatemode==SM_FLY); }); // Moved to /config/compatibility.cfg +//ICOMMANDF(currole, ARG_IVAL, (void) { return player1->clientrole; }); // Moved to /config/compatibility.cfg ICOMMANDF(curmastermode, ARG_IVAL, (void) { return servstate.mastermode; }); ICOMMANDF(curautoteam, ARG_IVAL, (void) { return servstate.autoteam; }); COMMAND(curmodeattr, ARG_1EST); @@ -327,7 +327,7 @@ void playerinfo(const char *cn, const char *attr) ATTR_INT(deaths, p->deaths); ATTR_INT(tks, p->tks); ATTR_INT(alive, p->state == CS_ALIVE ? 1 : 0); - ATTR_INT(spec, p->team == TEAM_SPECT || p->spectatemode == SM_FLY ? 1 : 0); + ATTR_INT(spect, p->team == TEAM_SPECT || p->spectatemode == SM_FLY ? 1 : 0); ATTR_INT(cn, p->clientnum); // only useful to get player1's client number. conoutf("invalid attribute: %s", attr); } @@ -1609,6 +1609,7 @@ void findcn(char *name) } COMMAND(findcn, ARG_1STR); +/* moved to /config/compatibility.cfg void findpn(int cn) { loopv(players) if(players[i] && players[i]->clientnum == cn) @@ -1620,6 +1621,7 @@ void findpn(int cn) result(""); } COMMAND(findpn, ARG_1INT); +*/ int sessionid = 0; @@ -1778,8 +1780,8 @@ COMMAND(togglespect, ARG_NONE); COMMAND(changefollowplayer, ARG_1INT); COMMAND(setfollowplayer, ARG_1INT); -int isalive() { return player1->state==CS_ALIVE ? 1 : 0; } -COMMANDN(alive, isalive, ARG_IVAL); +//int isalive() { return player1->state==CS_ALIVE ? 1 : 0; } +//COMMANDN(alive, isalive, ARG_IVAL); // Moved to /config/compatibility.cfg void serverextension(char *ext, char *args) {