Raised This Month: $7 Target: $400
 1% 

[CSGO] Blind Hook


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kailo
Senior Member
Join Date: Sep 2014
Location: Moscow, Russia
Old 02-11-2019 , 07:24   [CSGO] Blind Hook
Reply With Quote #1

About
Extension adds forward for flashbang's blind control.
Only for Counter-Strike: Global Offensive.

Download
GitHub@Kailo97/sm-blindhook * Releases page

Installation
Just drop archive content to 'csgo' folder.

Sources
GitHub@Kailo97/sm-blindhook

Usage
PHP Code:
/**
 * Called when a flashbang grenade perform player blinding.
 * Return Plugin_Continue to ignore or return a higher
 * action to protect player from blinding.
 *
 * @param client        Client index which must be blinded
 * @param attacker        Entity index of the grenade thrower or -1 if not available
 * @param inflictor        Entity index of the grenade projectile
 */
forward Action CS_OnBlindPlayer(int clientint attackerint inflictor); 
PHP Code:
#include <blindhook>

public Action CS_OnBlindPlayer(int clientint attackerint inflictor)
{
    
// Don't blind yourself
    
if (attacker == client)
        return 
Plugin_Stop;

    return 
Plugin_Continue;

Note
Attacker index may be -1 if player left game before grenade was detonate.
Client and Inflictor always valid entity ids.
If you want to get team of thrower or detonate coordinates, do it by inflictor.
PHP Code:
GetEntProp(inflictorProp_Data"m_iTeamNum");
GetEntPropVector(inflictorProp_Data"m_vecAbsOrigin"origin); 
Troubleshooting
Error: "Unable to read blindhook.games.txt"
Probably blindhook.games.txt is missing. Reupload latest extension version on server.

Error: "Failed to lookup RadiusFlash signature."
Try previous solution. If error still thrown, this means signature not correct for latest CS:GO version.
Wait for extension update. Track it at GitHub@Kailo97/sm-blindhook * Wiki page.

Another problems of extension may cause (and probably will be) server crash.
How to check? This can happen only at flashbang detonate moment.
If crash happen at another moment, Blind Hook not cause of it.

How works? Stability
GitHub@VSES/SourceEngine2007 * flashbang_projectile.cpp#L150
Extension set inline hook at RadiusFlash function loop. Fetch data from RadiusFlash variables to Handler function and call it.
If Handler return true, jump back to loop begin, otherwise jump back to hook point using trampoline method.
Read more how inline hooking and trampoline works here: MalwareTech
- Inline Hooking for Programmers (Part 1: Introduction)

How stable this? - not good
RadiusFlash big function that contain more 10 inline functions. Change any of it will cause offsets or signature change.
But i can sure you, i will maintain this ASAP for keep this at condition.
Kailo is offline
_GamerX
AlliedModders Donor
Join Date: Jun 2011
Location: Fun Server
Old 02-11-2019 , 12:46   Re: [CSGO] Blind Hook
Reply With Quote #2

good job
__________________
_GamerX is offline
Send a message via ICQ to _GamerX Send a message via Skype™ to _GamerX
Javierko
AlliedModders Donor
Join Date: Sep 2017
Location: Czech republic
Old 02-11-2019 , 12:58   Re: [CSGO] Blind Hook
Reply With Quote #3

Awesome ^^ gj
__________________
My Github & Sourcemod work.
If you like my work and if you want to support me, you can through PayPal.

Official SourceMod CZ/SK Discord: https://discord.gg/Qvar55a
Javierko is offline
ImACow
AlliedModders Donor
Join Date: Feb 2015
Old 02-12-2019 , 10:09   Re: [CSGO] Blind Hook
Reply With Quote #4

Thank you so much for this!
__________________
ImACow is offline
Kailo
Senior Member
Join Date: Sep 2014
Location: Moscow, Russia
Old 09-04-2021 , 16:59   Re: [CSGO] Blind Hook
Reply With Quote #5

Test version for CS:S OB released! (Linux only)
Download: https://github.com/Kailo97/sm-blindhook/releases (see blindhook-cssob-linux.zip at v1.3 release)
Soruces: https://github.com/Kailo97/sm-blindhook/tree/cssob
__________________
Kailo is offline
dyxL
Senior Member
Join Date: Jul 2010
Old 02-03-2023 , 19:03   Re: [CSGO] Blind Hook
Reply With Quote #6

any update?
dyxL is offline
TiBarification
Junior Member
Join Date: Aug 2012
Location: Ukraine
Old 02-03-2023 , 21:19   Re: [CSGO] Blind Hook
Reply With Quote #7

Quote:
Originally Posted by dyxL View Post
any update?
Try this one.
https://github.com/Kailo97/sm-blindh...eases/tag/v1.5
TiBarification 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 02:58.


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