From ef6da943d6a895a3339ff6be5c007197f5e02a29 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 22 Oct 2007 00:49:44 +0000 Subject: [PATCH] - moved more translation phrases around - converted more code to ProcessTargetString() --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401631 --- plugins/adminmenu.sp | 1 + plugins/basebans.sp | 1 + plugins/basefuncommands/burn.sp | 2 +- plugins/basefuncommands/slap.sp | 2 +- plugins/basefuncommands/slay.sp | 2 +- plugins/basefunvotes.sp | 2 +- plugins/basefunvotes/votealltalk.sp | 2 +- plugins/basefunvotes/voteburn.sp | 21 +++++-- plugins/basefunvotes/voteff.sp | 2 +- plugins/basefunvotes/votegravity.sp | 2 +- plugins/basefunvotes/voteslay.sp | 23 ++++++-- plugins/basevotes.sp | 6 +- plugins/basevotes/voteban.sp | 29 +++++++--- plugins/basevotes/votemap.sp | 2 +- translations/adminmenu.phrases.txt | 22 +++++++ translations/basebans.phrases.txt | 52 +++++++++++++++++ translations/basefunvotes.phrases.txt | 6 -- translations/common.phrases.txt | 83 +++------------------------ 18 files changed, 148 insertions(+), 112 deletions(-) create mode 100644 translations/adminmenu.phrases.txt create mode 100644 translations/basebans.phrases.txt diff --git a/plugins/adminmenu.sp b/plugins/adminmenu.sp index 1a2126c7..684ffee3 100644 --- a/plugins/adminmenu.sp +++ b/plugins/adminmenu.sp @@ -68,6 +68,7 @@ public bool:AskPluginLoad(Handle:myself, bool:late, String:error[], err_max) public OnPluginStart() { LoadTranslations("common.phrases"); + LoadTranslations("adminmenu.phrases"); hOnAdminMenuCreated = CreateGlobalForward("OnAdminMenuCreated", ET_Ignore, Param_Cell); hOnAdminMenuReady = CreateGlobalForward("OnAdminMenuReady", ET_Ignore, Param_Cell); diff --git a/plugins/basebans.sp b/plugins/basebans.sp index cf909e3e..bdb4e608 100644 --- a/plugins/basebans.sp +++ b/plugins/basebans.sp @@ -56,6 +56,7 @@ new g_BanTime[MAXPLAYERS+1]; public OnPluginStart() { LoadTranslations("common.phrases"); + LoadTranslations("basebans.phrases"); RegAdminCmd("sm_ban", Command_Ban, ADMFLAG_BAN, "sm_ban <#userid|name> [reason]"); RegAdminCmd("sm_unban", Command_Unban, ADMFLAG_UNBAN, "sm_unban "); diff --git a/plugins/basefuncommands/burn.sp b/plugins/basefuncommands/burn.sp index 6a1fac8c..8f5c07ad 100644 --- a/plugins/basefuncommands/burn.sp +++ b/plugins/basefuncommands/burn.sp @@ -112,7 +112,7 @@ public Action:Command_Burn(client, args) client, target_list, MAXPLAYERS, - COMMAND_FILTER_NO_BOTS, + COMMAND_FILTER_ALIVE, target_name, sizeof(target_name), tn_is_ml)) <= 0) diff --git a/plugins/basefuncommands/slap.sp b/plugins/basefuncommands/slap.sp index de89c7fa..b92c3d74 100644 --- a/plugins/basefuncommands/slap.sp +++ b/plugins/basefuncommands/slap.sp @@ -155,7 +155,7 @@ public Action:Command_Slap(client, args) client, target_list, MAXPLAYERS, - COMMAND_FILTER_NO_BOTS, + COMMAND_FILTER_ALIVE, target_name, sizeof(target_name), tn_is_ml)) <= 0) diff --git a/plugins/basefuncommands/slay.sp b/plugins/basefuncommands/slay.sp index 532a0d6e..736593d6 100644 --- a/plugins/basefuncommands/slay.sp +++ b/plugins/basefuncommands/slay.sp @@ -100,7 +100,7 @@ public Action:Command_Slay(client, args) client, target_list, MAXPLAYERS, - COMMAND_FILTER_NO_BOTS, + COMMAND_FILTER_ALIVE, target_name, sizeof(target_name), tn_is_ml)) <= 0) diff --git a/plugins/basefunvotes.sp b/plugins/basefunvotes.sp index 14285fef..d00df05e 100644 --- a/plugins/basefunvotes.sp +++ b/plugins/basefunvotes.sp @@ -269,7 +269,7 @@ public Handler_VoteCallback(Handle:menu, MenuAction:action, param1, param2) case (voteType:burn): { - PrintToChatAll("[SM] %t", "Ignited player", g_voteInfo[VOTE_NAME]); + PrintToChatAll("[SM] %t", "Set target on fire", "_s", g_voteInfo[VOTE_NAME]); LogAction(-1, g_voteClient[VOTE_CLIENTID], "Vote burn successful, igniting \"%L\"", g_voteClient[VOTE_CLIENTID]); IgniteEntity(g_voteClient[VOTE_CLIENTID], 19.8); diff --git a/plugins/basefunvotes/votealltalk.sp b/plugins/basefunvotes/votealltalk.sp index f4804dbd..a66b0a78 100644 --- a/plugins/basefunvotes/votealltalk.sp +++ b/plugins/basefunvotes/votealltalk.sp @@ -12,7 +12,7 @@ DisplayVoteAllTalkMenu(client) } LogAction(client, -1, "\"%L\" initiated an alltalk vote.", client); - ShowActivity(client, "%t", "Initiated Vote Alltalk"); + ShowActivity2(client, "[SM] ", "%t", "Initiated Vote Alltalk"); g_voteType = voteType:alltalk; g_voteInfo[VOTE_NAME][0] = '\0'; diff --git a/plugins/basefunvotes/voteburn.sp b/plugins/basefunvotes/voteburn.sp index cf455a27..8521e2da 100644 --- a/plugins/basefunvotes/voteburn.sp +++ b/plugins/basefunvotes/voteburn.sp @@ -1,4 +1,4 @@ -DisplayVoteBurnMenu(client,target,String:name[]) +DisplayVoteBurnMenu(client, target, String:name[]) { if (!IsPlayerAlive(target)) { @@ -10,7 +10,7 @@ DisplayVoteBurnMenu(client,target,String:name[]) GetClientName(target, g_voteInfo[VOTE_NAME], sizeof(g_voteInfo[])); LogAction(client, target, "\"%L\" initiated a burn vote against \"%L\"", client, target); - ShowActivity(client, "%t", "Initiated Vote Burn", g_voteInfo[VOTE_NAME]); + ShowActivity2(client, "[SM] ", "%t", "Initiated Vote Burn", g_voteInfo[VOTE_NAME]); g_voteType = voteType:burn; @@ -122,13 +122,24 @@ public Action:Command_VoteBurn(client, args) BreakString(text, arg, sizeof(arg)); - new target = FindTarget(client, arg); - if (target == -1) + decl String:target_name[MAX_TARGET_LENGTH]; + decl target_list[MAXPLAYERS], target_count, bool:tn_is_ml; + + if ((target_count = ProcessTargetString( + arg, + client, + target_list, + MAXPLAYERS, + COMMAND_FILTER_NO_MULTI, + target_name, + sizeof(target_name), + tn_is_ml)) <= 0) { + ReplyToTargetError(client, target_count); return Plugin_Handled; } - DisplayVoteBurnMenu(client, target, arg); + DisplayVoteBurnMenu(client, target_list[0], arg); return Plugin_Handled; } diff --git a/plugins/basefunvotes/voteff.sp b/plugins/basefunvotes/voteff.sp index c7081c09..8effadd9 100644 --- a/plugins/basefunvotes/voteff.sp +++ b/plugins/basefunvotes/voteff.sp @@ -12,7 +12,7 @@ DisplayVoteFFMenu(client) } LogAction(client, -1, "\"%L\" initiated a friendly fire vote.", client); - ShowActivity(client, "%t", "Initiated Vote FF"); + ShowActivity2(client, "[SM] ", "%t", "Initiated Vote FF"); g_voteType = voteType:ff; g_voteInfo[VOTE_NAME][0] = '\0'; diff --git a/plugins/basefunvotes/votegravity.sp b/plugins/basefunvotes/votegravity.sp index 923bc0e2..b5a37c7d 100644 --- a/plugins/basefunvotes/votegravity.sp +++ b/plugins/basefunvotes/votegravity.sp @@ -2,7 +2,7 @@ DisplayVoteGravityMenu(client,count,String:items[5][]) { LogAction(client, -1, "\"%L\" initiated a gravity vote.", client); - ShowActivity(client, "%t", "Initiated Vote Gravity"); + ShowActivity2(client, "[SM] ", "%t", "Initiated Vote Gravity"); g_voteType = voteType:gravity; diff --git a/plugins/basefunvotes/voteslay.sp b/plugins/basefunvotes/voteslay.sp index d1ed2e3b..f1a5aed2 100644 --- a/plugins/basefunvotes/voteslay.sp +++ b/plugins/basefunvotes/voteslay.sp @@ -1,5 +1,5 @@ -DisplayVoteSlayMenu(client,target,String:name[]) +DisplayVoteSlayMenu(client, target, String:name[]) { if (!IsPlayerAlive(target)) { @@ -11,7 +11,7 @@ DisplayVoteSlayMenu(client,target,String:name[]) GetClientName(target, g_voteInfo[VOTE_NAME], sizeof(g_voteInfo[])); LogAction(client, target, "\"%L\" initiated a slay vote against \"%L\"", client, target); - ShowActivity(client, "%t", "Initiated Vote Slay", g_voteInfo[VOTE_NAME]); + ShowActivity2(client, "[SM] ", "%t", "Initiated Vote Slay", g_voteInfo[VOTE_NAME]); g_voteType = voteType:slay; @@ -123,13 +123,24 @@ public Action:Command_VoteSlay(client, args) BreakString(text, arg, sizeof(arg)); - new target = FindTarget(client, arg); - if (target == -1) + decl String:target_name[MAX_TARGET_LENGTH]; + decl target_list[MAXPLAYERS], target_count, bool:tn_is_ml; + + if ((target_count = ProcessTargetString( + arg, + client, + target_list, + MAXPLAYERS, + COMMAND_FILTER_NO_MULTI, + target_name, + sizeof(target_name), + tn_is_ml)) <= 0) { + ReplyToTargetError(client, target_count); return Plugin_Handled; } - DisplayVoteSlayMenu(client, target, arg); + DisplayVoteSlayMenu(client, target_list[0], arg); return Plugin_Handled; -} \ No newline at end of file +} diff --git a/plugins/basevotes.sp b/plugins/basevotes.sp index c2c9e650..bfd02aae 100644 --- a/plugins/basevotes.sp +++ b/plugins/basevotes.sp @@ -100,6 +100,8 @@ public OnPluginStart() { LoadTranslations("common.phrases"); LoadTranslations("basevotes.phrases"); + LoadTranslations("plugin.basecommands"); + LoadTranslations("basebans.phrases"); RegAdminCmd("sm_votemap", Command_Votemap, ADMFLAG_VOTE|ADMFLAG_CHANGEMAP, "sm_votemap [mapname2] ... [mapname5] "); RegAdminCmd("sm_votekick", Command_Votekick, ADMFLAG_VOTE|ADMFLAG_KICK, "sm_votekick [reason]"); @@ -220,7 +222,7 @@ public Action:Command_Vote(client, args) } LogAction(client, -1, "\"%L\" initiated a generic vote.", client); - ShowActivity(client, "%t", "Initiate Vote", g_voteArg); + ShowActivity2(client, "[SM] ", "%t", "Initiate Vote", g_voteArg); g_voteType = voteType:question; @@ -349,7 +351,7 @@ public Handler_VoteCallback(Handle:menu, MenuAction:action, param1, param2) strcopy(g_voteArg, sizeof(g_voteArg), "Votekicked"); } - PrintToChatAll("[SM] %t", "Kicked player", g_voteInfo[VOTE_NAME]); + PrintToChatAll("[SM] %t", "Kicked target", "_s", g_voteInfo[VOTE_NAME]); LogAction(-1, g_voteClient[VOTE_CLIENTID], "Vote kick successful, kicked \"%L\" (reason \"%s\")", g_voteClient[VOTE_CLIENTID], g_voteArg); ServerCommand("kickid %d \"%s\"", g_voteClient[VOTE_USERID], g_voteArg); diff --git a/plugins/basevotes/voteban.sp b/plugins/basevotes/voteban.sp index 16831856..33a45db4 100644 --- a/plugins/basevotes/voteban.sp +++ b/plugins/basevotes/voteban.sp @@ -9,7 +9,7 @@ DisplayVoteBanMenu(client, target) GetClientIP(target, g_voteInfo[VOTE_IP], sizeof(g_voteInfo[])); LogAction(client, target, "\"%L\" initiated a ban vote against \"%L\"", client, target); - ShowActivity(client, "%t", "Initiated Vote Ban", g_voteInfo[VOTE_NAME]); + ShowActivity2(client, "[SM] ", "%t", "Initiated Vote Ban", g_voteInfo[VOTE_NAME]); g_voteType = voteType:ban; @@ -118,12 +118,6 @@ public Action:Command_Voteban(client, args) new len = BreakString(text, arg, sizeof(arg)); - new target = FindTarget(client, arg); - if (target == -1) - { - return Plugin_Handled; - } - if (len != -1) { strcopy(g_voteArg, sizeof(g_voteArg), text[len]); @@ -133,7 +127,24 @@ public Action:Command_Voteban(client, args) g_voteArg[0] = '\0'; } - DisplayVoteBanMenu(client, target); + decl String:target_name[MAX_TARGET_LENGTH]; + decl target_list[MAXPLAYERS], target_count, bool:tn_is_ml; + + if ((target_count = ProcessTargetString( + arg, + client, + target_list, + MAXPLAYERS, + COMMAND_FILTER_NO_MULTI, + target_name, + sizeof(target_name), + tn_is_ml)) <= 0) + { + ReplyToTargetError(client, target_count); + return Plugin_Handled; + } + + DisplayVoteBanMenu(client, target_list[0]); return Plugin_Handled; -} \ No newline at end of file +} diff --git a/plugins/basevotes/votemap.sp b/plugins/basevotes/votemap.sp index 63a7adcd..612ed187 100644 --- a/plugins/basevotes/votemap.sp +++ b/plugins/basevotes/votemap.sp @@ -2,7 +2,7 @@ DisplayVoteMapMenu(client, mapCount, String:maps[5][]) { LogAction(client, -1, "\"%L\" initiated a map vote.", client); - ShowActivity(client, "%t", "Initiated Vote Map"); + ShowActivity2(client, "[SM] ", "%t", "Initiated Vote Map"); g_voteType = voteType:map; diff --git a/translations/adminmenu.phrases.txt b/translations/adminmenu.phrases.txt new file mode 100644 index 00000000..529f018b --- /dev/null +++ b/translations/adminmenu.phrases.txt @@ -0,0 +1,22 @@ +"Phrases" +{ + "Admin Menu" + { + "en" "Admin Menu" + } + + "Player Commands" + { + "en" "Player Commands" + } + + "Server Commands" + { + "en" "Server Commands" + } + + "Voting Commands" + { + "en" "Voting Commands" + } +} diff --git a/translations/basebans.phrases.txt b/translations/basebans.phrases.txt new file mode 100644 index 00000000..4618fd17 --- /dev/null +++ b/translations/basebans.phrases.txt @@ -0,0 +1,52 @@ +"Phrases" +{ + "Ban player" + { + "en" "Ban player" + } + + "Ban reason" + { + "en" "Ban reason" + } + + "Permabanned player" + { + "#format" "{1:s}" + "en" "Permanently banned player \"{1}\"." + } + + "Permabanned player reason" + { + "#format" "{1:s},{2:s}" + "en" "Permanently banned player \"{1}\" (reason: {2})." + } + + "Banned player" + { + "#format" "{1:s},{2:d}" + "en" "Banned player \"{1}\" for {2} minutes." + } + + "Banned player reason" + { + "#format" "{1:s},{2:d},{3:s}" + "en" "Banned player \"{1}\" for {2} minutes (reason: {3})." + } + + "Removed bans matching" + { + "#format" "{1:s}" + "en" "Removed bans matching filter: {1}" + } + + "Ban added" + { + "en" "Ban has been added." + } + + "Cannot ban that IP" + { + "en" "You cannot ban that IP address." + } +} diff --git a/translations/basefunvotes.phrases.txt b/translations/basefunvotes.phrases.txt index 90844f1c..e993daa5 100644 --- a/translations/basefunvotes.phrases.txt +++ b/translations/basefunvotes.phrases.txt @@ -99,10 +99,4 @@ { "en" "Slay vote" } - - "Ignited player" - { - "#format" "{1:s}" - "en" "Set player '{1}' on fire" - } } diff --git a/translations/common.phrases.txt b/translations/common.phrases.txt index 78789984..9859db5f 100644 --- a/translations/common.phrases.txt +++ b/translations/common.phrases.txt @@ -41,12 +41,6 @@ "en" "Kick player" } - "Kicked player" - { - "#format" "{1:s}" - "en" "Kicked player '{1}'" - } - "Kicked by admin" { "en" "Kicked by administrator" @@ -123,41 +117,6 @@ "#format" "{1:s}" "en" "Executed config \"{1}\"." } - - "Permabanned player" - { - "#format" "{1:s}" - "en" "Permanently banned player \"{1}\"." - } - - "Permabanned player reason" - { - "#format" "{1:s},{2:s}" - "en" "Permanently banned player \"{1}\" (reason: {2})." - } - - "Banned player" - { - "#format" "{1:s},{2:d}" - "en" "Banned player \"{1}\" for {2} minutes." - } - - "Banned player reason" - { - "#format" "{1:s},{2:d},{3:s}" - "en" "Banned player \"{1}\" for {2} minutes (reason: {3})." - } - - "Removed bans matching" - { - "#format" "{1:s}" - "en" "Removed bans matching filter: {1}" - } - - "Ban added" - { - "en" "Ban has been added." - } "Admin cache refreshed" { @@ -232,52 +191,17 @@ { "en" "Failed to query database." } - - "Cannot ban that IP" - { - "en" "You cannot ban that IP address." - } "Invalid SteamID specified" { "en" "You have specified an invalid Steam ID (must start with 'STEAM_0:')." } - "Admin Menu" - { - "en" "Admin Menu" - } - - "Player Commands" - { - "en" "Player Commands" - } - - "Server Commands" - { - "en" "Server Commands" - } - - "Voting Commands" - { - "en" "Voting Commands" - } - "Reload admins" { "en" "Reload admins" } - "Ban player" - { - "en" "Ban player" - } - - "Ban reason" - { - "en" "Ban reason" - } - "Command is in-game only" { "en" "This command can only be used in-game." @@ -318,4 +242,11 @@ "#format" "{1:s}" "en" "Slayed player '{1}'" } + + /* :UNUSED: */ + "Kicked player" + { + "#format" "{1:s}" + "en" "Kicked player '{1}'" + } }