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

[L4D2] Is there a way to block kickclient()?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
LinLinLin
Senior Member
Join Date: Sep 2021
Old 07-25-2023 , 11:12   [L4D2] Is there a way to block kickclient()?
Reply With Quote #1

Is it possible to block other plugins which use KickClient()?
I want to add my judgement before it fire.
I guess maybe use PreThink and check IsClientInKickQueue(), but how to block the kick action?
LinLinLin is offline
BRU7US
Member
Join Date: Jul 2020
Location: Tatarstan, Kazan
Old 07-25-2023 , 18:11   Re: [L4D2] Is there a way to block kickclient()?
Reply With Quote #2

It is much easier to block this on the action of the menu button itself, which produces how, for example, through the admin menu. But there is no logic in this, because to cancel the action of the administrator personally to someone would be very strange, for this there is a level of access rights, which determines which of the admins is higher and who has more authority. And if you still need to block the kick of a simple player, it is easier to do it by blocking the vote for player kick or button action, as I have already described above.
BRU7US is offline
LinLinLin
Senior Member
Join Date: Sep 2021
Old 07-26-2023 , 01:33   Re: [L4D2] Is there a way to block kickclient()?
Reply With Quote #3

Since other plugins use KickClient() and i can't modify his logic, whatever it use a menu or vote.
An example is when using sm admin menu to kick someone, i can't add my logic except i rewrite the kick.sp and compile it again.

I want to find a way to block this kick action globlly, make it a forward would be better.
LinLinLin is offline
Paimon
Member
Join Date: Jul 2021
Location: Zootopia
Old 07-26-2023 , 03:58   Re: [L4D2] Is there a way to block kickclient()?
Reply With Quote #4

An idea, not test.
Try DHook this
PHP Code:
CBaseServer::DisconnectClient(IClient *, char const*) 
and return MRES_Supercede to skip disconnect.

The original function is
PHP Code:
void DisconnectClient(IClient *client, const char *reason
You could find it at engine_srv.so

Last edited by Paimon; 07-26-2023 at 03:58.
Paimon 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 16:12.


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