- moved more translation phrases around

- converted more code to ProcessTargetString()

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401631
This commit is contained in:
David Anderson 2007-10-22 00:49:44 +00:00
parent 53156446d4
commit ef6da943d6
18 changed files with 148 additions and 112 deletions

View File

@ -68,6 +68,7 @@ public bool:AskPluginLoad(Handle:myself, bool:late, String:error[], err_max)
public OnPluginStart() public OnPluginStart()
{ {
LoadTranslations("common.phrases"); LoadTranslations("common.phrases");
LoadTranslations("adminmenu.phrases");
hOnAdminMenuCreated = CreateGlobalForward("OnAdminMenuCreated", ET_Ignore, Param_Cell); hOnAdminMenuCreated = CreateGlobalForward("OnAdminMenuCreated", ET_Ignore, Param_Cell);
hOnAdminMenuReady = CreateGlobalForward("OnAdminMenuReady", ET_Ignore, Param_Cell); hOnAdminMenuReady = CreateGlobalForward("OnAdminMenuReady", ET_Ignore, Param_Cell);

View File

@ -56,6 +56,7 @@ new g_BanTime[MAXPLAYERS+1];
public OnPluginStart() public OnPluginStart()
{ {
LoadTranslations("common.phrases"); LoadTranslations("common.phrases");
LoadTranslations("basebans.phrases");
RegAdminCmd("sm_ban", Command_Ban, ADMFLAG_BAN, "sm_ban <#userid|name> <minutes|0> [reason]"); RegAdminCmd("sm_ban", Command_Ban, ADMFLAG_BAN, "sm_ban <#userid|name> <minutes|0> [reason]");
RegAdminCmd("sm_unban", Command_Unban, ADMFLAG_UNBAN, "sm_unban <steamid>"); RegAdminCmd("sm_unban", Command_Unban, ADMFLAG_UNBAN, "sm_unban <steamid>");

View File

@ -112,7 +112,7 @@ public Action:Command_Burn(client, args)
client, client,
target_list, target_list,
MAXPLAYERS, MAXPLAYERS,
COMMAND_FILTER_NO_BOTS, COMMAND_FILTER_ALIVE,
target_name, target_name,
sizeof(target_name), sizeof(target_name),
tn_is_ml)) <= 0) tn_is_ml)) <= 0)

View File

@ -155,7 +155,7 @@ public Action:Command_Slap(client, args)
client, client,
target_list, target_list,
MAXPLAYERS, MAXPLAYERS,
COMMAND_FILTER_NO_BOTS, COMMAND_FILTER_ALIVE,
target_name, target_name,
sizeof(target_name), sizeof(target_name),
tn_is_ml)) <= 0) tn_is_ml)) <= 0)

View File

@ -100,7 +100,7 @@ public Action:Command_Slay(client, args)
client, client,
target_list, target_list,
MAXPLAYERS, MAXPLAYERS,
COMMAND_FILTER_NO_BOTS, COMMAND_FILTER_ALIVE,
target_name, target_name,
sizeof(target_name), sizeof(target_name),
tn_is_ml)) <= 0) tn_is_ml)) <= 0)

View File

@ -269,7 +269,7 @@ public Handler_VoteCallback(Handle:menu, MenuAction:action, param1, param2)
case (voteType:burn): 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]); LogAction(-1, g_voteClient[VOTE_CLIENTID], "Vote burn successful, igniting \"%L\"", g_voteClient[VOTE_CLIENTID]);
IgniteEntity(g_voteClient[VOTE_CLIENTID], 19.8); IgniteEntity(g_voteClient[VOTE_CLIENTID], 19.8);

View File

@ -12,7 +12,7 @@ DisplayVoteAllTalkMenu(client)
} }
LogAction(client, -1, "\"%L\" initiated an alltalk vote.", 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_voteType = voteType:alltalk;
g_voteInfo[VOTE_NAME][0] = '\0'; g_voteInfo[VOTE_NAME][0] = '\0';

View File

@ -1,4 +1,4 @@
DisplayVoteBurnMenu(client,target,String:name[]) DisplayVoteBurnMenu(client, target, String:name[])
{ {
if (!IsPlayerAlive(target)) if (!IsPlayerAlive(target))
{ {
@ -10,7 +10,7 @@ DisplayVoteBurnMenu(client,target,String:name[])
GetClientName(target, g_voteInfo[VOTE_NAME], sizeof(g_voteInfo[])); GetClientName(target, g_voteInfo[VOTE_NAME], sizeof(g_voteInfo[]));
LogAction(client, target, "\"%L\" initiated a burn vote against \"%L\"", client, target); 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; g_voteType = voteType:burn;
@ -122,13 +122,24 @@ public Action:Command_VoteBurn(client, args)
BreakString(text, arg, sizeof(arg)); BreakString(text, arg, sizeof(arg));
new target = FindTarget(client, arg); decl String:target_name[MAX_TARGET_LENGTH];
if (target == -1) 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; return Plugin_Handled;
} }
DisplayVoteBurnMenu(client, target, arg); DisplayVoteBurnMenu(client, target_list[0], arg);
return Plugin_Handled; return Plugin_Handled;
} }

View File

@ -12,7 +12,7 @@ DisplayVoteFFMenu(client)
} }
LogAction(client, -1, "\"%L\" initiated a friendly fire vote.", 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_voteType = voteType:ff;
g_voteInfo[VOTE_NAME][0] = '\0'; g_voteInfo[VOTE_NAME][0] = '\0';

View File

@ -2,7 +2,7 @@
DisplayVoteGravityMenu(client,count,String:items[5][]) DisplayVoteGravityMenu(client,count,String:items[5][])
{ {
LogAction(client, -1, "\"%L\" initiated a gravity vote.", client); 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; g_voteType = voteType:gravity;

View File

@ -1,5 +1,5 @@
DisplayVoteSlayMenu(client,target,String:name[]) DisplayVoteSlayMenu(client, target, String:name[])
{ {
if (!IsPlayerAlive(target)) if (!IsPlayerAlive(target))
{ {
@ -11,7 +11,7 @@ DisplayVoteSlayMenu(client,target,String:name[])
GetClientName(target, g_voteInfo[VOTE_NAME], sizeof(g_voteInfo[])); GetClientName(target, g_voteInfo[VOTE_NAME], sizeof(g_voteInfo[]));
LogAction(client, target, "\"%L\" initiated a slay vote against \"%L\"", client, target); 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; g_voteType = voteType:slay;
@ -123,13 +123,24 @@ public Action:Command_VoteSlay(client, args)
BreakString(text, arg, sizeof(arg)); BreakString(text, arg, sizeof(arg));
new target = FindTarget(client, arg); decl String:target_name[MAX_TARGET_LENGTH];
if (target == -1) 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; return Plugin_Handled;
} }
DisplayVoteSlayMenu(client, target, arg); DisplayVoteSlayMenu(client, target_list[0], arg);
return Plugin_Handled; return Plugin_Handled;
} }

View File

@ -100,6 +100,8 @@ public OnPluginStart()
{ {
LoadTranslations("common.phrases"); LoadTranslations("common.phrases");
LoadTranslations("basevotes.phrases"); LoadTranslations("basevotes.phrases");
LoadTranslations("plugin.basecommands");
LoadTranslations("basebans.phrases");
RegAdminCmd("sm_votemap", Command_Votemap, ADMFLAG_VOTE|ADMFLAG_CHANGEMAP, "sm_votemap <mapname> [mapname2] ... [mapname5] "); RegAdminCmd("sm_votemap", Command_Votemap, ADMFLAG_VOTE|ADMFLAG_CHANGEMAP, "sm_votemap <mapname> [mapname2] ... [mapname5] ");
RegAdminCmd("sm_votekick", Command_Votekick, ADMFLAG_VOTE|ADMFLAG_KICK, "sm_votekick <player> [reason]"); RegAdminCmd("sm_votekick", Command_Votekick, ADMFLAG_VOTE|ADMFLAG_KICK, "sm_votekick <player> [reason]");
@ -220,7 +222,7 @@ public Action:Command_Vote(client, args)
} }
LogAction(client, -1, "\"%L\" initiated a generic vote.", client); 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; g_voteType = voteType:question;
@ -349,7 +351,7 @@ public Handler_VoteCallback(Handle:menu, MenuAction:action, param1, param2)
strcopy(g_voteArg, sizeof(g_voteArg), "Votekicked"); 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); 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); ServerCommand("kickid %d \"%s\"", g_voteClient[VOTE_USERID], g_voteArg);

View File

@ -9,7 +9,7 @@ DisplayVoteBanMenu(client, target)
GetClientIP(target, g_voteInfo[VOTE_IP], sizeof(g_voteInfo[])); GetClientIP(target, g_voteInfo[VOTE_IP], sizeof(g_voteInfo[]));
LogAction(client, target, "\"%L\" initiated a ban vote against \"%L\"", client, target); 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; g_voteType = voteType:ban;
@ -118,12 +118,6 @@ public Action:Command_Voteban(client, args)
new len = BreakString(text, arg, sizeof(arg)); new len = BreakString(text, arg, sizeof(arg));
new target = FindTarget(client, arg);
if (target == -1)
{
return Plugin_Handled;
}
if (len != -1) if (len != -1)
{ {
strcopy(g_voteArg, sizeof(g_voteArg), text[len]); strcopy(g_voteArg, sizeof(g_voteArg), text[len]);
@ -133,7 +127,24 @@ public Action:Command_Voteban(client, args)
g_voteArg[0] = '\0'; 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; return Plugin_Handled;
} }

View File

@ -2,7 +2,7 @@
DisplayVoteMapMenu(client, mapCount, String:maps[5][]) DisplayVoteMapMenu(client, mapCount, String:maps[5][])
{ {
LogAction(client, -1, "\"%L\" initiated a map vote.", client); 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; g_voteType = voteType:map;

View File

@ -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"
}
}

View File

@ -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."
}
}

View File

@ -99,10 +99,4 @@
{ {
"en" "Slay vote" "en" "Slay vote"
} }
"Ignited player"
{
"#format" "{1:s}"
"en" "Set player '{1}' on fire"
}
} }

View File

@ -41,12 +41,6 @@
"en" "Kick player" "en" "Kick player"
} }
"Kicked player"
{
"#format" "{1:s}"
"en" "Kicked player '{1}'"
}
"Kicked by admin" "Kicked by admin"
{ {
"en" "Kicked by administrator" "en" "Kicked by administrator"
@ -123,41 +117,6 @@
"#format" "{1:s}" "#format" "{1:s}"
"en" "Executed config \"{1}\"." "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" "Admin cache refreshed"
{ {
@ -232,52 +191,17 @@
{ {
"en" "Failed to query database." "en" "Failed to query database."
} }
"Cannot ban that IP"
{
"en" "You cannot ban that IP address."
}
"Invalid SteamID specified" "Invalid SteamID specified"
{ {
"en" "You have specified an invalid Steam ID (must start with 'STEAM_0:')." "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" "Reload admins"
{ {
"en" "Reload admins" "en" "Reload admins"
} }
"Ban player"
{
"en" "Ban player"
}
"Ban reason"
{
"en" "Ban reason"
}
"Command is in-game only" "Command is in-game only"
{ {
"en" "This command can only be used in-game." "en" "This command can only be used in-game."
@ -318,4 +242,11 @@
"#format" "{1:s}" "#format" "{1:s}"
"en" "Slayed player '{1}'" "en" "Slayed player '{1}'"
} }
/* :UNUSED: */
"Kicked player"
{
"#format" "{1:s}"
"en" "Kicked player '{1}'"
}
} }