Logging changes to various base plugins.

This commit is contained in:
Obuss
2019-12-05 18:56:28 +01:00
committed by BotoX
parent da2c643675
commit 6b3ca53a92
15 changed files with 125 additions and 139 deletions
+7 -6
View File
@@ -33,10 +33,8 @@
char g_NewName[MAXPLAYERS+1][MAX_NAME_LENGTH];
void PerformRename(int client, int target)
void PerformRename(int target)
{
LogAction(client, target, "\"%L\" renamed \"%L\" (to \"%s\")", client, target, g_NewName[target]);
SetClientName(target, g_NewName[target]);
g_NewName[target][0] = '\0';
@@ -109,7 +107,8 @@ public int MenuHandler_Rename(Menu menu, MenuAction action, int param1, int para
RandomizeName(target);
ShowActivity2(param1, "[SM] ", "%t", "Renamed target", "_s", name);
PerformRename(param1, target);
LogAction(param1, target, "\"%L\" renamed \"%L\" to \"%s\")", param1, target, g_NewName[target]);
PerformRename(target);
}
DisplayRenameTargetMenu(param1);
}
@@ -168,12 +167,14 @@ public Action Command_Rename(int client, int args)
if (tn_is_ml)
{
ShowActivity2(client, "[SM] ", "%t", "Renamed target", target_name);
LogAction(client, -1, "\"%L\" renamed \"%s\" to \"%s\")", client, target_name, arg2);
}
else
{
ShowActivity2(client, "[SM] ", "%t", "Renamed target", "_s", target_name);
LogAction(client, target_list[0], "\"%L\" renamed \"%L\" to \"%s\")", client, target_list[0], arg2);
}
for (int i = 0; i < target_count; i++)
{
if (randomize)
@@ -191,7 +192,7 @@ public Action Command_Rename(int client, int args)
Format(g_NewName[target_list[i]], MAX_NAME_LENGTH, "%s", arg2);
}
}
PerformRename(client, target_list[i]);
PerformRename(target_list[i]);
}
}
else
+5 -8
View File
@@ -33,12 +33,6 @@
int g_SlapDamage[MAXPLAYERS+1];
void PerformSlap(int client, int target, int damage)
{
LogAction(client, target, "\"%L\" slapped \"%L\" (damage \"%d\")", client, target, damage);
SlapPlayer(target, damage, true);
}
void DisplaySlapDamageMenu(int client)
{
Menu menu = new Menu(MenuHandler_SlapDamage);
@@ -151,7 +145,8 @@ public int MenuHandler_Slap(Menu menu, MenuAction action, int param1, int param2
{
char name[MAX_NAME_LENGTH];
GetClientName(target, name, sizeof(name));
PerformSlap(param1, target, g_SlapDamage[param1]);
SlapPlayer(target, g_SlapDamage[param1]);
LogAction(param1, target, "\"%L\" slapped \"%L\" (damage \"%d\")", param1, target, g_SlapDamage[param1]);
ShowActivity2(param1, "[SM] ", "%t", "Slapped target", "_s", name);
}
@@ -202,16 +197,18 @@ public Action Command_Slap(int client, int args)
for (int i = 0; i < target_count; i++)
{
PerformSlap(client, target_list[i], damage);
SlapPlayer(target_list[i], damage);
}
if (tn_is_ml)
{
ShowActivity2(client, "[SM] ", "%t", "Slapped target", target_name);
LogAction(client, -1, "\"%L\" slapped \"%s\" (damage \"%d\")", client, target_name, damage);
}
else
{
ShowActivity2(client, "[SM] ", "%t", "Slapped target", "_s", target_name);
LogAction(client, target_list[0], "\"%L\" slapped \"%L\" (damage \"%d\")", client, target_list[0], damage);
}
return Plugin_Handled;
+5 -8
View File
@@ -31,12 +31,6 @@
* Version: $Id$
*/
void PerformSlay(int client, int target)
{
LogAction(client, target, "\"%L\" slayed \"%L\"", client, target);
ForcePlayerSuicide(target);
}
void DisplaySlayMenu(int client)
{
Menu menu = new Menu(MenuHandler_Slay);
@@ -105,7 +99,8 @@ public int MenuHandler_Slay(Menu menu, MenuAction action, int param1, int param2
{
char name[MAX_NAME_LENGTH];
GetClientName(target, name, sizeof(name));
PerformSlay(param1, target);
ForcePlayerSuicide(target);
LogAction(param1, target, "\"%L\" slayed \"%L\"", param1, target);
ShowActivity2(param1, "[SM] ", "%t", "Slayed target", "_s", name);
}
@@ -144,16 +139,18 @@ public Action Command_Slay(int client, int args)
for (int i = 0; i < target_count; i++)
{
PerformSlay(client, target_list[i]);
ForcePlayerSuicide(target_list[i]);
}
if (tn_is_ml)
{
ShowActivity2(client, "[SM] ", "%t", "Slayed target", target_name);
LogAction(client, -1, "\"%L\" slayed \"%s\"", client, target_name);
}
else
{
ShowActivity2(client, "[SM] ", "%t", "Slayed target", "_s", target_name);
LogAction(client, target_list[0], "\"%L\" slayed \"%L\"", client, target_list[0]);
}
return Plugin_Handled;