From 880e27e128ba868a6a33d1f45a8fc64cd8d78f9d Mon Sep 17 00:00:00 2001 From: Samual Date: Sat, 3 Dec 2011 01:48:34 -0500 Subject: [PATCH] string VoteCommand_getprefix() to distinguish between "cmd" and "sv_cmd" in messages --- qcsrc/server/clientcommands.qc | 2 +- qcsrc/server/vote.qc | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/qcsrc/server/clientcommands.qc b/qcsrc/server/clientcommands.qc index a4f08e8dd..febaf1a62 100644 --- a/qcsrc/server/clientcommands.qc +++ b/qcsrc/server/clientcommands.qc @@ -894,7 +894,7 @@ void ClientCommand_(float request) CLIENT_COMMAND("timein", ClientCommand_timein(request), "Resume the game from being paused with a timeout") \ CLIENT_COMMAND("timeout", ClientCommand_timeout(request), "Call a timeout which pauses the game for certain amount of time unless unpaused") \ CLIENT_COMMAND("voice", ClientCommand_voice(request, arguments, command), "Send voice message via sound") \ - CLIENT_COMMAND("vote", VoteCommand(self, arguments), "Request an action to be voted upon by players") \ // handled in server/vote.qc + CLIENT_COMMAND("vote", VoteCommand(self, arguments), "Request an action to be voted upon by players") // handled in server/vote.qc \ /* nothing */ void ClientCommand_macro_help() diff --git a/qcsrc/server/vote.qc b/qcsrc/server/vote.qc index 9b029e343..e3855c2d9 100644 --- a/qcsrc/server/vote.qc +++ b/qcsrc/server/vote.qc @@ -1,6 +1,6 @@ // ============================================= // Server side voting code, reworked by Samual -// Last updated: November 30th, 2011 +// Last updated: December 4th, 2011 // ============================================= #define VC_REQUEST_COMMAND 1 @@ -31,7 +31,13 @@ float Votecommand_check_assignment(entity caller, float assignment) return FALSE; } -string VoteCommand_ +string VoteCommand_getprefix(entity caller) +{ + if(caller) + return "cmd"; + else + return "sv_cmd"; +} float Nagger_SendEntity(entity to, float sendflags) { @@ -440,14 +446,14 @@ void VoteCommand_(float request) // Do not hard code aliases for these, instead create them in commands.cfg... also: keep in alphabetical order, please ;) #define VOTE_COMMANDS(request,caller,arguments) \ VOTE_COMMAND("abstain", VoteCommand_abstain(request, caller), "", VC_ASGNMNT_CLIENTONLY) \ - VOTE_COMMAND("help", VoteCommand_help(caller), "", VC_ASGNMNT_BOTH) \ + VOTE_COMMAND("help", VoteCommand_macro_help(caller), "", VC_ASGNMNT_BOTH) \ VOTE_COMMAND("stop", VoteCommand_stop(request, caller), "", VC_ASGNMNT_BOTH) \ //VOTE_COMMAND("", VoteCommand_(request, caller, arguments), "", ) \ /* nothing */ void VoteCommand_macro_help(entity caller) { - print("\nUsage:^3 cmd vote COMMAND...^7, where possible commands are:\n"); + print("\nUsage:^3 ", VoteCommand_getprefix(caller), " vote COMMAND...^7, where possible commands are:\n"); #define VOTE_COMMAND(name,function,description,assignment) \ { if(Votecommand_check_assignment(caller, assignment)) { print(" ^2", name, "^7: ", description, "\n"); } } -- 2.39.2