- improved comments on ShowActivity() natives

- switched to ShowActivity2() in basecommands
- added lifestates offsets to core gamedata file
- added a few translation phrases that were missing
- added new API calls to IPlayerHelpers for extending target processing

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401629
This commit is contained in:
David Anderson
2007-10-21 20:35:15 +00:00
parent f5370eb171
commit 04b2845b0d
10 changed files with 194 additions and 37 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ PerformCancelVote(client)
return;
}
ShowActivity(client, "%t", "Cancelled Vote");
ShowActivity2(client, "[SM] ", "%t", "Cancelled Vote");
CancelVote();
}
+1 -1
View File
@@ -8,7 +8,7 @@ PerformExec(client, String:path[])
return;
}
ShowActivity(client, "%t", "Executed config", path[4]);
ShowActivity2(client, "[SM] ", "%t", "Executed config", path[4]);
LogAction(client, -1, "\"%L\" executed config (file \"%s\")", client, path[4]);
+47 -13
View File
@@ -1,11 +1,6 @@
PerformKick(client, target, const String:reason[])
{
decl String:name[MAX_NAME_LENGTH];
GetClientName(target, name, sizeof(name));
ShowActivity(client, "%t", "Kicked player", name);
LogAction(client, target, "\"%L\" kicked \"%L\" (reason \"%s\")", client, target, reason);
if (reason[0] == '\0')
@@ -80,6 +75,9 @@ public MenuHandler_Kick(Handle:menu, MenuAction:action, param1, param2)
}
else
{
decl String:name[MAX_NAME_LENGTH];
GetClientName(target, name, sizeof(name));
ShowActivity2(param1, "[SM] ", "%t", "Kicked target", "_S", name);
PerformKick(param1, target, "");
}
@@ -104,13 +102,7 @@ public Action:Command_Kick(client, args)
decl String:arg[65];
new len = BreakString(Arguments, arg, sizeof(arg));
new target = FindTarget(client, arg);
if (target == -1)
{
return Plugin_Handled;
}
if (len == -1)
{
/* Safely null terminate */
@@ -118,7 +110,49 @@ public Action:Command_Kick(client, args)
Arguments[0] = '\0';
}
PerformKick(client, target, Arguments[len]);
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_CONNECTED,
target_name,
sizeof(target_name),
tn_is_ml)) > 0)
{
if (tn_is_ml)
{
ShowActivity2(client, "[SM] ", "%t", "Kicked target", target_name);
}
else
{
ShowActivity2(client, "[SM] ", "%t", "Kicked target", "_S", target_name);
}
new kick_self = 0;
for (new i = 0; i < target_count; i++)
{
/* Kick everyone else first */
if (target_list[i] == client)
{
kick_self = client;
}
PerformKick(client, target_list[i], Arguments[len]);
}
if (kick_self)
{
PerformKick(client, client, Arguments[len]);
}
}
else
{
ReplyToTargetError(client, target_count);
}
return Plugin_Handled;
}
+2 -2
View File
@@ -14,7 +14,7 @@ public MenuHandler_ChangeMap(Handle:menu, MenuAction:action, param1, param2)
GetMenuItem(menu, param2, map, sizeof(map));
ShowActivity(param1, "%t", "Changing map", map);
ShowActivity2(param1, "[SM] ", "%t", "Changing map", map);
LogAction(param1, -1, "\"%L\" changed map to \"%s\"", param1, map);
@@ -59,7 +59,7 @@ public Action:Command_Map(client, args)
return Plugin_Handled;
}
ShowActivity(client, "%t", "Changing map", map);
ShowActivity2(client, "[SM] ", "%t", "Changing map", map);
LogAction(client, -1, "\"%L\" changed map to \"%s\"", client, map);