plugins/basecommands.sp
changeset 1378 115ba755bcdf
parent 1376 1d799689de9a
child 1417 79f72a315320
     1.1 --- a/plugins/basecommands.sp	Sun Aug 26 20:12:30 2007 +0000
     1.2 +++ b/plugins/basecommands.sp	Mon Aug 27 02:00:37 2007 +0000
     1.3 @@ -76,7 +76,7 @@
     1.4  	DumpAdminCache(AdminCache_Groups, true);
     1.5  	DumpAdminCache(AdminCache_Overrides, true);
     1.6  
     1.7 -	LogMessage("\"%L\" refreshed the admin cache.", client);
     1.8 +	LogAction(client, -1, "\"%L\" refreshed the admin cache.", client);
     1.9  	ReplyToCommand(client, "[SM] %t", "Admin cache refreshed");
    1.10  
    1.11  	return Plugin_Handled;
    1.12 @@ -113,16 +113,16 @@
    1.13  		has_rcon = (id == INVALID_ADMIN_ID) ? false : GetAdminFlag(id, Admin_RCON);
    1.14  	}
    1.15  	
    1.16 -	new bool:hit_client = false;
    1.17 +	new hit_client = -1;
    1.18  	if (numClients == 1 
    1.19  		&& !IsFakeClient(clients[0])
    1.20  		&& (has_rcon || CanUserTarget(client, clients[0])))
    1.21  	{
    1.22  		GetClientIP(clients[0], arg, sizeof(arg));
    1.23 -		hit_client = true;
    1.24 +		hit_client = clients[0];
    1.25  	}
    1.26  	
    1.27 -	if (!hit_client && !has_rcon)
    1.28 +	if (hit_client == -1 && !has_rcon)
    1.29  	{
    1.30  		ReplyToCommand(client, "[SM] %t", "No Access");
    1.31  		return Plugin_Handled;
    1.32 @@ -146,7 +146,7 @@
    1.33  
    1.34  	if (act < Plugin_Handled)
    1.35  	{
    1.36 -		LogMessage("\"%L\" added ban (minutes \"%d\") (ip \"%s\") (reason \"%s\")", client, minutes, arg, reason);
    1.37 +		LogAction(client, hit_client, "\"%L\" added ban (minutes \"%d\") (ip \"%s\") (reason \"%s\")", client, minutes, arg, reason);
    1.38  		ReplyToCommand(client, "[SM] %t", "Ban added");
    1.39  	}
    1.40  
    1.41 @@ -189,7 +189,7 @@
    1.42  
    1.43  	if (act < Plugin_Handled)
    1.44  	{
    1.45 -		LogMessage("\"%L\" added ban (minutes \"%d\") (id \"%s\") (reason \"%s\")", client, minutes, arg, reason);
    1.46 +		LogAction(client, -1, "\"%L\" added ban (minutes \"%d\") (id \"%s\") (reason \"%s\")", client, minutes, arg, reason);
    1.47  		ReplyToCommand(client, "[SM] %t", "Ban added");
    1.48  	}
    1.49  
    1.50 @@ -243,7 +243,7 @@
    1.51  
    1.52  	if (act < Plugin_Handled)
    1.53  	{
    1.54 -		LogMessage("\"%L\" removed ban (filter \"%s\")", client, new_arg);
    1.55 +		LogAction(client, -1, "\"%L\" removed ban (filter \"%s\")", client, new_arg);
    1.56  		ReplyToCommand(client, "[SM] %t", "Removed bans matching", new_arg);
    1.57  	}
    1.58  
    1.59 @@ -317,7 +317,7 @@
    1.60  				ShowActivity(client, "%t", "Banned player reason", arg, time, reason);
    1.61  			}
    1.62  		}
    1.63 -		LogMessage("\"%L\" banned \"%L\" (minutes \"%d\") (reason \"%s\")", client, target, time, reason);
    1.64 +		LogAction(client, target, "\"%L\" banned \"%L\" (minutes \"%d\") (reason \"%s\")", client, target, time, reason);
    1.65  	}
    1.66  
    1.67  	if (act < Plugin_Stop)
    1.68 @@ -491,7 +491,7 @@
    1.69  
    1.70  	ShowActivity(client, "%t", "Executed config", path[4]);
    1.71  
    1.72 -	LogMessage("\"%L\" executed config (file \"%s\")", client, path[4]);
    1.73 +	LogAction(client, -1, "\"%L\" executed config (file \"%s\")", client, path[4]);
    1.74  
    1.75  	ServerCommand("exec \"%s\"", path[4]);
    1.76  
    1.77 @@ -569,7 +569,7 @@
    1.78  		ReplyToCommand(client, "[SM] %t", "Cvar changed", cvarname, value);
    1.79  	}
    1.80  
    1.81 -	LogMessage("\"%L\" changed cvar (cvar \"%s\") (value \"%s\")", client, cvarname, value);
    1.82 +	LogAction(client, -1, "\"%L\" changed cvar (cvar \"%s\") (value \"%s\")", client, cvarname, value);
    1.83  
    1.84  	SetConVarString(hndl, value, true);
    1.85  
    1.86 @@ -587,7 +587,7 @@
    1.87  	decl String:argstring[255];
    1.88  	GetCmdArgString(argstring, sizeof(argstring));
    1.89  
    1.90 -	LogMessage("\"%L\" console command (cmdline \"%s\")", client, argstring);
    1.91 +	LogAction(client, -1, "\"%L\" console command (cmdline \"%s\")", client, argstring);
    1.92  
    1.93  	ServerCommand("%s", argstring);
    1.94  
    1.95 @@ -613,7 +613,7 @@
    1.96  
    1.97  	ShowActivity(client, "%t", "Changing map", map);
    1.98  
    1.99 -	LogMessage("\"%L\" changed map to \"%s\"", client, map);
   1.100 +	LogAction(client, -1, "\"%L\" changed map to \"%s\"", client, map);
   1.101  
   1.102  	new Handle:dp;
   1.103  	CreateDataTimer(3.0, Timer_ChangeMap, dp);
   1.104 @@ -665,7 +665,7 @@
   1.105  	}
   1.106  
   1.107  	ShowActivity(client, "%t", "Kicked player", arg);
   1.108 -	LogMessage("\"%L\" kicked \"%L\" (reason \"%s\")", client, target, Arguments[len]);
   1.109 +	LogAction(client, target, "\"%L\" kicked \"%L\" (reason \"%s\")", client, target, Arguments[len]);
   1.110  
   1.111  	KickClient(target, "%s", Arguments[len]);
   1.112