Raised This Month: $12 Target: $400
 3% 

Solved Can't block kill/explode in TF2


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hkkelvin1995
Senior Member
Join Date: Jun 2009
Location: Hong Kong
Old 03-10-2020 , 23:52   Can't block kill/explode in TF2
Reply With Quote #1

Is it not possible to block suicide command like 'kill' and 'explode' anymore?
I have written a small plugin like the following:
Code:
public OnPluginStart() 
{
    AddCommandListener(Cmd_Kill, "kill");
    AddCommandListener(Cmd_Explode, "explode");
}

public Action Cmd_Kill(int client, const char[] command, int args)
{
    PrintToChatAll("You're not allowed to suicide");
    return Plugin_Handled;
}

public Action Cmd_Explode(int client, const char[] command, int args)
{
    PrintToChatAll("You're not allowed to suicide");
    return Plugin_Handled;
}
EDIT: Update or Remove old version of https://forums.alliedmods.net/showthread.php?p=2217736, then solved.
__________________
Founder of Reachhl2.com from Hong Kong 🇭🇰
10+ years experience in hosting SCRDS
Best known for our VSH/FF2 server with self-made Bosses, Features, Maps

Last edited by hkkelvin1995; 03-11-2020 at 19:01. Reason: Solved, Old Bumper Car plugin also intercepts kill/explode command
hkkelvin1995 is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 03-11-2020 , 14:08   Re: Can't block kill/explode in TF2
Reply With Quote #2

Try this, maybe they use third command.
PHP Code:
public void OnPluginStart()
{
    
AddCommandListener(listener"kill");
    
AddCommandListener(listener"explode");
    
AddCommandListener(listener"hurtme");
}

public 
Action listener(int client, const char[] commandint argc)
{
    if(
client == || !IsClientInGame(client) || IsFakeClient(client) || !IsPlayerAlive(client))
        return 
Plugin_Continue;


    
PrintToChat(client"\x01\x04[SM] \x01Command '%s' is disabled from server"command);

    return 
Plugin_Handled;

__________________
Do not Private Message @me
Bacardi is offline
hkkelvin1995
Senior Member
Join Date: Jun 2009
Location: Hong Kong
Old 03-11-2020 , 17:56   Re: Can't block kill/explode in TF2
Reply With Quote #3

Quote:
Originally Posted by Bacardi View Post
Try this, maybe they use third command.
PHP Code:
public void OnPluginStart()
{
    
AddCommandListener(listener"kill");
    
AddCommandListener(listener"explode");
    
AddCommandListener(listener"hurtme");
}

public 
Action listener(int client, const char[] commandint argc)
{
    if(
client == || !IsClientInGame(client) || IsFakeClient(client) || !IsPlayerAlive(client))
        return 
Plugin_Continue;


    
PrintToChat(client"\x01\x04[SM] \x01Command '%s' is disabled from server"command);

    return 
Plugin_Handled;

Thanks for you help, but I can still kill myself by typing in 'kill' or 'explode' on a non-admin account. Even Freak Fortress 2's built-in kill blocker doesn't work as well, I even tried to unload the entire FF2 plugins and only have mine(with what you gave me above) loaded but it still couldn't block the 'kill' and 'explode' command. There is no any error message in the console, this really drives me crazy.
__________________
Founder of Reachhl2.com from Hong Kong 🇭🇰
10+ years experience in hosting SCRDS
Best known for our VSH/FF2 server with self-made Bosses, Features, Maps
hkkelvin1995 is offline
PC Gamer
Veteran Member
Join Date: Mar 2014
Old 03-11-2020 , 18:17   Re: Can't block kill/explode in TF2
Reply With Quote #4

As a short term solution while you debug the issue may be to edit your addons/sourcemod/configs/admin_overrides.cfg

Add these lines to the file:
PHP Code:
"sm_kill"   "z"
"sm_explode"   "z"
"sm_hurtme"   "z" 
That should ensure that only players with the Root flag will be able to execute those commands.
PC Gamer is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 03-11-2020 , 18:44   Re: Can't block kill/explode in TF2
Reply With Quote #5

...unload other plugins one by one till it works ?

Or, check and make sure you are loading and running plugin on server. (sm plugins list)
__________________
Do not Private Message @me

Last edited by Bacardi; 03-11-2020 at 18:45.
Bacardi is offline
hkkelvin1995
Senior Member
Join Date: Jun 2009
Location: Hong Kong
Old 03-11-2020 , 18:56   Re: Can't block kill/explode in TF2
Reply With Quote #6

Quote:
Originally Posted by Bacardi View Post
...unload other plugins one by one till it works ?

Or, check and make sure you are loading and running plugin on server. (sm plugins list)
Hey you're right, I made a second sourcemod installation and found out I had an old version of https://forums.alliedmods.net/showthread.php?p=2217736, which also intercepts the kill commands, this is why the kill/explode commands still go through, thanks for spending you time trying to help me. This is just so dumb.
__________________
Founder of Reachhl2.com from Hong Kong 🇭🇰
10+ years experience in hosting SCRDS
Best known for our VSH/FF2 server with self-made Bosses, Features, Maps
hkkelvin1995 is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 03-12-2020 , 04:08   Re: Can't block kill/explode in TF2
Reply With Quote #7



good
__________________
Do not Private Message @me
Bacardi is offline
Reply


Thread Tools
Display Modes

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 09:37.


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