Raised This Month: $32 Target: $400
 8% 

How to block player consol command - kill


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
guven5
Senior Member
Join Date: Jul 2010
Location: counter strike 1.6 downl
Old 12-22-2017 , 23:26   How to block player consol command - kill
Reply With Quote #1

Consol command kill sometimes useful, if player stucked in the somewhere for several reason like map bug etc but also annoy if mod mission base like zombie plague.
anyways ideas for that ?

Last edited by guven5; 12-22-2017 at 23:27.
guven5 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-23-2017 , 00:25   Re: How to block player consol command - kill
Reply With Quote #2

When searching for things, first search this forum using the native search function. If you can't find what you need do a search via a general purpose search engine these forums called out as the site to search like this.

The first result there was a plugin that does exactly what you need.
__________________

Last edited by fysiks; 12-23-2017 at 00:31.
fysiks is offline
guven5
Senior Member
Join Date: Jul 2010
Location: counter strike 1.6 downl
Old 12-23-2017 , 17:31   Re: How to block player consol command - kill
Reply With Quote #3

i always start with search but looks i have lost my search skill
your plugin advice works as well like charm, merci for help
guven5 is offline
glmmlg
Member
Join Date: Apr 2014
Old 01-02-2018 , 04:13   Re: How to block player consol command - kill
Reply With Quote #4

try this

Quote:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

public plugin_init()
register_forward(FM_ClientKill, "fwd_FM_ClientKill");

public fwd_FM_ClientKill(id) {
if(is_user_alive(id))
return FMRES_SUPERCEDE;

return FMRES_IGNORED;
}
glmmlg is offline
Send a message via Skype™ to glmmlg
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 01-02-2018 , 08:50   Re: How to block player consol command - kill
Reply With Quote #5

@glmmlg why do you check for alive?
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
xakintosh
I run no-steam servers!
Join Date: Feb 2010
Location: Edge of nowhere
Old 01-22-2018 , 12:49   Re: How to block player consol command - kill
Reply With Quote #6

Quote:
Originally Posted by PRoSToTeM@ View Post
@glmmlg why do you check for alive?
If you are dead you can't kill yourself ?
__________________
As soon as possible.
xakintosh is offline
Send a message via Yahoo to xakintosh Send a message via Skype™ to xakintosh
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-22-2018 , 20:38   Re: How to block player consol command - kill
Reply With Quote #7

Quote:
Originally Posted by xakintosh View Post
If you are dead you can't kill yourself ?
Which means that the function won't even be called anyways.
__________________
fysiks is offline
Undercloacked
Member
Join Date: Jun 2012
Old 01-23-2018 , 11:41   Re: How to block player consol command - kill
Reply With Quote #8

Here you go:

Quote:
/*
Block Kill 1.2
Author: leonard19941

Cvar's:

amx_bkenabled: ( Default: 1 )
0 - Disabled Block Kill.
1 - Enable Block Kill.

amx_bkteam: ( Default: 0 )
0 - Enable Block Kill for all Teams.
1 - Enable Block Kill only Terrorists.
2 - Enable Block Kill only Counter-Terrorists.
*/

#include <amxmodx>
#include <cstrike>
#include <fakemeta>

#define VERSION "1.2"

new g_pCvarBKEnabled, g_pCvarBKTeam;

public plugin_init( )
{
register_plugin( "Block Kill", VERSION, "leonard19941" );

g_pCvarBKEnabled = register_cvar( "amx_bkenabled", "1" );
g_pCvarBKTeam = register_cvar( "amx_bkteam", "0" );

register_forward( FM_ClientKill, "Fw_ClientKill" );
}

public Fw_ClientKill( const id )
{
if( !is_user_alive( id ) && is_user_connected( id ) )
return FMRES_IGNORED;

if( get_pcvar_num( g_pCvarBKEnabled ) && ( get_pcvar_num( g_pCvarBKTeam ) & ( _:cs_get_user_team( id ) ) ) )
{
if( cs_get_user_team( id ) == CS_TEAM_T )
{
client_print( id, print_center, "The Terrorists cannot Suicide!" );
return FMRES_SUPERCEDE;
}
else
{
client_print( id, print_center, "The Counter-Terrorists cannot Suicide!" );
return FMRES_SUPERCEDE;
}
}
else if( get_pcvar_num( g_pCvarBKTeam ) == 0 )
{
client_print( id, print_center, "You can't kill yourself!" );
client_print( id, print_console, "You can't kill yourself!" );
return FMRES_SUPERCEDE;
}

return FMRES_IGNORED;
}
The plugin's not mine(obviously), but I've tested it and works fine.

Last edited by Undercloacked; 01-23-2018 at 11:41.
Undercloacked 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 01:01.


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