summaryrefslogtreecommitdiff
path: root/src/game/g_cmds.c
diff options
context:
space:
mode:
authorMikko Tiusanen <ams@daug.net>2014-10-15 21:16:06 +0300
committerMikko Tiusanen <ams@daug.net>2014-10-15 21:16:06 +0300
commit8268afc55026f70cd21a7941e1228cfd9adeb0a8 (patch)
tree2439ce84a6ae39f40cf0a460db87036597a2d969 /src/game/g_cmds.c
parentcb6e022bb7aadf56d4f7ebc136f652fc18fbc44e (diff)
Added automatic levels functionality based on total score earned of each player.
Diffstat (limited to 'src/game/g_cmds.c')
-rw-r--r--src/game/g_cmds.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index f865d93..fa6b6c9 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -3637,6 +3637,7 @@ commands_t cmds[ ] = {
{ "m", CMD_MESSAGE|CMD_INTERMISSION, Cmd_PrivateMessage_f },
{ "maplog", CMD_MESSAGE|CMD_INTERMISSION, Cmd_MapLog_f },
{ "mt", CMD_MESSAGE|CMD_INTERMISSION, Cmd_PrivateMessage_f },
+ { "myscore", 0, Cmd_MyScore_f },
{ "noclip", CMD_CHEAT_TEAM, Cmd_Noclip_f },
{ "notarget", CMD_CHEAT|CMD_TEAM|CMD_LIVING, Cmd_Notarget_f },
{ "reload", CMD_HUMAN|CMD_LIVING, Cmd_Reload_f },
@@ -3812,6 +3813,24 @@ void G_UnEscapeString( char *in, char *out, int len )
*out = '\0';
}
+void Cmd_MyScore_f( gentity_t *ent )
+{
+ g_admin_level_t *n;
+ if ( !ent || !ent->client->pers.admin ) {
+ ADMP( "This command is only available for registered players.\n" );
+ return;
+ }
+ if ( n = G_admin_level_next( G_admin_level( ent->client->pers.admin->level ) ) ) {
+ ADMP( va( "^7Level %d (%s^7) total score earned: %d next level: %d\n",
+ ent->client->pers.admin->level, G_admin_level( ent->client->pers.admin->level )->name,
+ ent->client->pers.admin->score, n->score ) );
+ } else {
+ ADMP( va( "^7Level %d (%s^7) total score earned: %d (max level)\n",
+ ent->client->pers.admin->level, G_admin_level( ent->client->pers.admin->level )->name,
+ ent->client->pers.admin->score ) );
+ }
+}
+
void Cmd_PrivateMessage_f( gentity_t *ent )
{
int pids[ MAX_CLIENTS ];