Raised This Month: $ Target: $400
 0% 

Show bans to non-admins


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ChocOrange
Member
Join Date: Feb 2009
Old 05-25-2013 , 00:32   Show bans to non-admins
Reply With Quote #1

Currently SMAC sends messages to admins when a ban is administered.

Could you please add an option so that these messages can also be seen by non-admins. It makes it a lot easier than explaining why someone was just banned.

eg smac_ban_msg_all "1" // displays the ban information to all players on the server

Warnings for suspected hack behavior should, of course, remain admins only.
ChocOrange is offline
DoPe^
Veteran Member
Join Date: Jul 2008
Location: Denmark / Copenhagen
Old 05-25-2013 , 08:06   Re: Show bans to non-admins
Reply With Quote #2

As I know, the clients on our server can see the smac messages when people get's banned.
__________________
DoPe^ is offline
ChocOrange
Member
Join Date: Feb 2009
Old 05-25-2013 , 13:28   Re: Show bans to non-admins
Reply With Quote #3

Quote:
Originally Posted by DoPe^ View Post
As I know, the clients on our server can see the smac messages when people get's banned.
Where a detection can be set to ban a player or warn admins of a potential hacker (eg the eye angle module) it uses "SMAC_PrintAdminNotice" for the notification.

The code displays to admins what the issue is and then bans if smac is set to ban eg (code trimmed for space).

Code:
SMAC_PrintAdminNotice("%t", "SMAC_EyetestDetected", client);
                    
if (GetConVarBool(g_hCvarBan))
    {
         SMAC_LogAction(client, "was banned for tampering with an old movement command etc....
         SMAC_Ban(client, "Eye Test Violation");
    }
    else
    {
        SMAC_LogAction(client, "is suspected of tampering with an old movement command etc....
    }
What would be nicer is if it's set to "auto ban" then all players should see the message otherwise only admins see it. For example move the SMAC_PrintAdminNotice into the "then" and a "PrintToChatAll" in the "else" or some similar solution.

Last edited by ChocOrange; 05-25-2013 at 13:29.
ChocOrange is offline
SystematicMania
Senior Member
Join Date: Aug 2012
Old 05-26-2013 , 10:35   Re: Show bans to non-admins
Reply With Quote #4

It's possible to show notifications to non-admins using overrides.

Alternatively, you could try a hacky way, such as this:

Code:
#pragma semicolon 1

#include <sourcemod>
#include <smac>

public OnPluginStart()
{
	LoadTranslations("smac.phrases");
}

public Action:SMAC_OnCheatDetected(client, const String:module[])
{
	if (StrEqual(module, "smac_eyetest.smx"))
	{
		for (new i = 1; i <= MaxClients; i++)
		{
			if (IsClientInGame(i) && !CheckCommandAccess(i, "smac_admin_notices", ADMFLAG_GENERIC, true))
			{
				PrintToChat(i, "%t", "SMAC_EyetestDetected", client);
			}
		}
	}

	return Plugin_Continue;
}
__________________

Last edited by SystematicMania; 05-26-2013 at 14:16.
SystematicMania is offline
ChocOrange
Member
Join Date: Feb 2009
Old 05-26-2013 , 11:57   Re: Show bans to non-admins
Reply With Quote #5

I can hack it in no problem. I was wondering if it could be included officially so everyone benefits and I don't have to re-edit on new releases.
At present no-one on the server knows about the ban apart from admins. This differs from the rest of the ban behaviors.
ChocOrange is offline
SystematicMania
Senior Member
Join Date: Aug 2012
Old 05-26-2013 , 13:12   Re: Show bans to non-admins
Reply With Quote #6

Quote:
Originally Posted by ChocOrange View Post
I was wondering if it could be included officially so everyone benefits
It probably won't be implemented unless there is substantial demand for it.

Quote:
Originally Posted by ChocOrange View Post
I don't have to re-edit on new releases.
If it's done in a standalone plugin using SMAC_OnCheatDetected, then it will continue to work after future updates.

Quote:
Originally Posted by ChocOrange View Post
At present no-one on the server knows about the ban apart from admins. This differs from the rest of the ban behaviors.
I think you misunderstood what that code snippet did.
__________________
SystematicMania is offline
ChocOrange
Member
Join Date: Feb 2009
Old 05-27-2013 , 01:22   Re: Show bans to non-admins
Reply With Quote #7

Thanks for the code snipet and a nice way of doing it
Just for info, if anyone copies it - I suggest changing the message so it doesn't say "suspected" using the built in message on a ban.
ChocOrange is offline
Shit on shoe
Senior Member
Join Date: Jul 2010
Old 06-09-2013 , 23:46   Re: Show bans to non-admins
Reply With Quote #8

to override it , is this example okey ?

Quote:
Overrides
{
"smac_admin_notices" "" //Allow anyone to see "smac_admin_notices"
}
__________________

Last edited by Shit on shoe; 06-09-2013 at 23:47.
Shit on shoe is offline
allienaded
AlliedModders Donor
Join Date: Feb 2013
Old 06-12-2013 , 13:09   Re: Show bans to non-admins
Reply With Quote #9

Quote:
Originally Posted by Shit on shoe View Post
to override it , is this example okey ?
Yes. This is the format I personally use:

PHP Code:
Overrides
{
    
"smac_admin_notices"    ""

allienaded is offline
Shit on shoe
Senior Member
Join Date: Jul 2010
Old 06-15-2013 , 16:01   Re: Show bans to non-admins
Reply With Quote #10

i got problem if i try override

Quote:
131:54: [SM] [1] Line 344, smac.sp::Native_PrintAdminNotice()
L 06/15/2013 - 131:54: [SM] Plugin encountered error 25: Call was aborted
L 06/15/2013 - 131:54: [SM] Native "SMAC_PrintAdminNotice" reported: Error encountered while processing a dynamic native
L 06/15/2013 - 131:54: [SM] Displaying call stack trace for plugin "smac_eyetest.smx":
L 06/15/2013 - 131:54: [SM] [0] Line 170, smac_eyetest.sp::OnPlayerRunCmd()
L 06/15/2013 - 137:17: [SM] Plugin encountered error 25: Call was aborted
L 06/15/2013 - 137:17: [SM] Native "ThrowError" reported: Client 17 is not in game
L 06/15/2013 - 137:17: [SM] Displaying call stack trace for plugin "smac.smx":
L 06/15/2013 - 137:17: [SM] [0] Line 59, D:\srcds\css\cstrike\addons\sourcemod\scripti ng\include\colors.inc::CPrintToChat()
L 06/15/2013 - 137:17: [SM] [1] Line 344, smac.sp::Native_PrintAdminNotice()
L 06/15/2013 - 137:17: [SM] Plugin encountered error 25: Call was aborted
L 06/15/2013 - 137:17: [SM] Native "SMAC_PrintAdminNotice" reported: Error encountered while processing a dynamic native
L 06/15/2013 - 137:17: [SM] Displaying call stack trace for plugin "smac_eyetest.smx":
L 06/15/2013 - 137:17: [SM] [0] Line 170, smac_eyetest.sp::OnPlayerRunCmd()
L 06/15/2013 - 13:44:12: Error log file session closed.
L 06/15/2013 - 194:07: SourceMod error session started
L 06/15/2013 - 194:07: Info (map "gg_Lego_MAFIA_arena") (file "errors_20130615.log")
L 06/15/2013 - 194:07: [SM] Native "ReadPackString" reported: DataPack operation is out of bounds.
L 06/15/2013 - 194:07: [SM] Displaying call stack trace for plugin "vacbans.smx":
L 06/15/2013 - 194:07: [SM] [0] Line 165, vacbans.sp::OnSocketDisconnected()
L 06/15/2013 - 19:41:52: Error log file session closed.
__________________
Shit on shoe is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:15.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode