From 50058ee474eac817d5bca0f2135bc53b0f7a1eb1 Mon Sep 17 00:00:00 2001 From: Samual Date: Thu, 29 Dec 2011 13:26:59 -0500 Subject: [PATCH] Finish todo's for vote.qc --- qcsrc/server/command/vote.qc | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/qcsrc/server/command/vote.qc b/qcsrc/server/command/vote.qc index 0a9412338..9548ab7ff 100644 --- a/qcsrc/server/command/vote.qc +++ b/qcsrc/server/command/vote.qc @@ -512,7 +512,6 @@ string ValidateMap(string validated_map, entity caller) float VoteCommand_parse(entity caller, string vote_command, string vote_list, float startpos, float argc) { string first_command; - entity victim; first_command = argv(startpos); @@ -539,11 +538,23 @@ float VoteCommand_parse(entity caller, string vote_command, string vote_list, fl case "kick": case "kickban": // catch all kick/kickban commands { - victim = GetIndexedEntity(argc, (startpos + 1)); - if not(victim) { return FALSE; } - // TODO: figure out how kick/kickban/ban commands work and re-write this to fit around them - vote_parsed_command = vote_command; - vote_parsed_display = strcat("^1", vote_command, " (^7", victim.netname, "^1): ", "todo"); + entity victim = GetIndexedEntity(argc, (startpos + 1)); + float accepted = VerifyClientEntity(victim, TRUE, FALSE); + + if(accepted > 0) + { + string reason = ((argc > next_token) ? substring(vote_command, argv_start_index(next_token), argv_end_index(-1) - argv_start_index(next_token)) : "No reason provided."); + string command_arguments; + + if(first_command == "kickban") + command_arguments = strcat(ftos(autocvar_g_ban_default_bantime), " ", ftos(autocvar_g_ban_default_masksize), " ~"); + else + command_arguments = reason; + + vote_parsed_command = strcat(first_command, " # ", ftos(num_for_edict(victim)), " ", command_arguments); + vote_parsed_display = strcat("^1", vote_command, " (^7", victim.netname, "^1): ", reason); + } + else { print_to(caller, strcat("vcall: ", GetClientErrorString(accepted, argv(startpos + 1)), ".\n")); return FALSE; } break; } -- 2.39.2