AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Extensions (https://forums.alliedmods.net/forumdisplay.php?f=134)
-   -   [CS:S] Flashbang Tools (https://forums.alliedmods.net/showthread.php?t=159876)

Dr!fter 06-22-2011 20:08

[CS:S] Flashbang Tools
 
2 Attachment(s)
This extension adds some useful forwards sourcepawn for flashbangs. Ive had it for a very long time. But found it mostly useless to me and thought others would find it useless as well (It was originally for learning). But recently I've noticed people trying to do things with flashbangs. Removing the sound when you are flashed. Grabbing info when it detonates etc... So I decided to release it.

Note: I only tested in windows. It was a rather rushed release everything still compiled the signatures for windows were correct.

Forwards:
PHP Code:

/**
* @param client        Client index
* @param distance    How far the flash is from the player which will effect the volume and length of the "deafen"

* @return             Plugin_Handled or higher to block. Plugin_Changed if distance was changed. Plugin_Continue to ignore.
*  
*/
forward Action:OnDeafen(client, &Float:distance);

/**
* @param entity        The flashbang entity

* @return             Plugin_Handled or higher to block. Anything else to ignore
*  
*/
forward Action:OnFlashDetonate(entity);

/**
* @param client        Client index
* @param entity        The flashbang entity
* @param pos        The position vector of the flashbang
* @param percent    The percent?

* @return             Plugin_Handled or higher to ignore player. Plugin_Changed if percent was changed. Plugin_Continue to ignore 

*/
forward Action:OnGetPercentageOfFlashForPlayer(cliententityFloat:pos[3], &Float:percent); 

I have no clue how the percent for OnGetPercentageOfFlashForPlayer works. I tried changing it and couldn't notice any changes (its been awhile since i tried) but you can try it :P

Example:
PHP Code:

#include <sourcemod>
#include <flashtools>

public Action:OnDeafen(client, &Float:distance)
{
    
//Dont "Deafen" anyone
    
return Plugin_Handled;
}
public 
Action:OnGetPercentageOfFlashForPlayer(cliententityFloat:pos[3], &Float:percent)
{
    new 
owner GetEntPropEnt(entityProp_Send"m_hOwnerEntity");
    new 
team GetClientTeam(client);
    new 
team2 GetClientTeam(owner);
    
//Dont team flash but flash the owner
    
if(team == team2 && owner != client)
    {
        return 
Plugin_Handled;
    }
    
    return 
Plugin_Continue;
}
public 
Action:OnFlashDetonate(entity)
{
    new 
bool:cookies false;
    
    
//Stop Detonate
    
if(cookies)
        return 
Plugin_Handled;
    
    return 
Plugin_Continue;
    


I couldn't think of anything useful for OnFlashDetonate i guess its useful for getting info from the flashbang or stopping one from detonating for some reason.

You only need flashbang-tools.zip for most stuff unless you need to recompile.

nightrider 06-22-2011 21:47

Re: [CS:S] Flashbang Tools
 
Interesting, thank you for sharing.

away000 06-22-2011 21:53

Re: [CS:S] Flashbang Tools
 
I hope this will open some ways to developers =D Great job man....

Despirator 06-23-2011 01:20

Re: [CS:S] Flashbang Tools
 
awesome, thank you. I'll try

you forgot attach the include file

Edit:
It works very well, I was looking for it long time

Edit:
Found another way to stop a flash beep sound http://forums.alliedmods.net/showthread.php?p=1493993

Bacardi 06-23-2011 03:54

Re: [CS:S] Flashbang Tools
 
Wierd...
PHP Code:

forward Action:OnDeafen(client, &Float:time); 

the further away flashbang explode, time is much bigger than flashbang what explode on your feet.
Hope I explained it well

*edit
It measure like range ?

Dr!fter 06-23-2011 09:44

Re: [CS:S] Flashbang Tools
 
Quote:

Originally Posted by Bacardi (Post 1493976)
Wierd...
PHP Code:

forward Action:OnDeafen(client, &Float:time); 

the further away flashbang explode, time is much bigger than flashbang what explode on your feet.
Hope I explained it well

*edit
It measure like range ?

Ill have a look it might be wrong. I a) didn't really care what they were and didn't look into it much before. b) assumed things. So ill have a look.

Bacardi 06-23-2011 10:06

Re: [CS:S] Flashbang Tools
 
Ok, but I start use that like measure now and works great.

Dr!fter 06-23-2011 10:52

Re: [CS:S] Flashbang Tools
 
Quote:

Originally Posted by Bacardi (Post 1494158)
Ok, but I start use that like measure now and works great.

Indeed it looks like it is distance. It checks if the distance is within a radius then "deafens" accordingly.

From IDA:
PHP Code:

v6 134;
v4 a2;
if ( 
a2 <= 600.0 || (v6 135v4 <= 800.0) || (v6 136v4 <= 1000.0) ) 

So anything less than 600 has the highest deafen anything over 1000 units away doesn't deafen.

I also had a look at the percentage thing it seems it just returns 1.0 if the player will be blind and returns 0.0 if they will not be.

I updated the include file and changed the extension source code to change that time for OnDeafen is actually distance. Thanks for pointing it out. I also attached the inc file its in the main zip.

Bacardi 06-23-2011 13:59

Re: [CS:S] Flashbang Tools
 
goood... http://avatar.hq-picture.com/avatars...ture_11168.jpg

FlexXx 10-28-2011 11:08

Re: [CS:S] Flashbang Tools
 
is it possible to change the collision of the flash ?
cause they collide with other people but not with yourself and i want to also collide it with myself.
would be nice if someone can help me.

Tauphi 05-23-2012 01:43

Re: [CS:S] Flashbang Tools
 
With the latest CS:S update the PercentageOfFlashForPlayer signature changed.
Is there any chance to get it updated?

Dr!fter 08-16-2012 12:33

Re: [CS:S] Flashbang Tools
 
I have update the gamedata inside the zip and have also updated the extension for cs:go support along with cs:go gamedata.

GibloeDelo 12-30-2012 19:05

Re: [CS:S] Flashbang Tools
 
1 Attachment(s)
Updated signature for update:
Code:

Counter-Strike: Source
Protocol version 22
Exe version 1.0.0.75 (cstrike)
Exe build: 16:19:22 Sep 20, 2012 (5066) (240)

Attachment 113847


Dr!fter, why the request PercentageOfFlashForPlayer not working?

RedSword 12-30-2012 19:39

Re: [CS:S] Flashbang Tools
 
Quote:

Originally Posted by GibloeDelo (Post 1863811)
Updated signature for update:
Code:

Counter-Strike: Source
Protocol version 22
Exe version 1.0.0.75 (cstrike)
Exe build: 16:19:22 Sep 20, 2012 (5066) (240)

Attachment 113847


Dr!fter, why the request PercentageOfFlashForPlayer not working?

I did get it to work, thanks to your signature.

edit : I mean by this the PercentageOfFlashForPlayer

dordnung 02-25-2013 09:56

Re: [CS:S] Flashbang Tools
 
2 Attachment(s)
Hey, i compiled the binarys with the newest csgo, css and sourcemod sdks. Here:

altair540 02-25-2013 15:18

Re: [CS:S] Flashbang Tools
 
On sourcemod 1.4.7 not working.

Quote:

[SM] Unable to load extension "flashtools.ext": Could not find interface: IGameHelpers

dordnung 02-25-2013 18:42

Re: [CS:S] Flashbang Tools
 
Yes i think you need the newest sourcemod

TnTSCS 04-15-2013 17:43

Re: [CS:S] Flashbang Tools
 
am I doing something wrong? with the below code, using the flashtools-0.0.4, I get errors.

code


errors


I would expect something like 50% or 87.62% or something - maybe I'm missing something or messed something up.

minimoney1 04-15-2013 19:00

Re: [CS:S] Flashbang Tools
 
Quote:

Originally Posted by TnTSCS (Post 1933362)
am I doing something wrong? with the below code, using the flashtools-0.0.4, I get errors.

code


errors


I would expect something like 50% or 87.62% or something - maybe I'm missing something or messed something up.

Quote:

Originally Posted by Dr!fter (Post 1493858)
I have no clue how the percent for OnGetPercentageOfFlashForPlayer works. I tried changing it and couldn't notice any changes (its been awhile since i tried) but you can try it :P


shavit 09-23-2013 20:45

Re: [CS:S] Flashbang Tools
 
Can someone update gamedata for 17 September's update?

Dr!fter 09-25-2013 09:57

Re: [CS:S] Flashbang Tools
 
Code:

"Games"
{
        "cstrike"
        {
                "Signatures"
                {
                        "Deafen"
                        {
                                "library"                "server"
                                "windows"                "\x55\x8B\xEC\x83\xEC\x28\x89\x4D\xD8\x8B\x45\xD8\x8B\x10\x8B\x4D\xD8"
                                "linux"                        "@_ZN9CCSPlayer6DeafenEf"
                        }
                        "CFlashbangProjectile::Detonate"
                        {
                                "library"                "server"
                                "windows"                "\x53\x56\x8B\xF1\x8B\x86\x00\x01\x00\x00\xC1\xE8\x0B\x57\xA8\x01\x74\x2A\xE8\x2A\x2A\x2A\x2A\xF3\x0F\x10\x05\x2A\x2A\x2A\x2A\x6A\x40"
                                "linux"                        "@_ZN20CFlashbangProjectile8DetonateEv"
                        }
                        "PercentageOfFlashForPlayer"
                        {
                                "library"                "server"
                                "windows"                "\x55\x8B\xEC\x81\xEC\xB0\x00\x00\x00\x56\x8B\x75\x08\x8B\x06"
                                "linux"                        "@_Z26PercentageOfFlashForPlayerP11CBaseEntity6VectorS0_"
                        }

                }
        }
}


kadet.89 09-28-2013 04:14

Re: [CS:S] Flashbang Tools
 
Dr!fter, how did you find a description of these functions (prototypes ...e.t.c)?

RedSword 09-28-2013 12:45

Re: [CS:S] Flashbang Tools
 
Using a hex editor (probably IDA : Hex Rays) and searching in the linux server binary. Function names are present so it's that hard to find a function you want.

ProdigySim has streamed himself doing some sig scanning. i.e. http://www.twitch.tv/prodigysim/c/2536037

There are also threads on the subject in the forum.

kadet.89 10-05-2013 09:01

Re: [CS:S] Flashbang Tools
 
3 Attachment(s)
PHP Code:

/**
* @param client        The hegrenade entity

* @return             Plugin_Handled or higher to block. Anything else to ignore
*  
*/
forward Action:OnHEDetonate(entity);


/**
* @param client        The grenade entity

* @return             Plugin_Handled or higher to block. Anything else to ignore
*  
*/
forward Action:OnGrenadeSpawn(entity); 

replace grenade model:

falafili 01-18-2014 09:43

Re: [CS:S] Flashbang Tools
 
Hi all!
I have some troubles with loading this extension:
L 01/18/2014 - 18:28:41: [SM] Unable to load extension "flashtools.ext": /lib32/libm.so.6: version `GLIBC_2.15' not found (required by bin/libvstdlib.so)
Server's working on linux and that's why it causes such error, is not it?
Hope u will help =)

Desura 02-03-2014 04:50

Re: [CS:S] Flashbang Tools
 
Can we add flash duration?

Bacardi 02-07-2014 07:43

Re: [CS:S] Flashbang Tools
 
Quote:

Originally Posted by Desura (Post 2094664)
Can we add flash duration?

Hook event "player_blind" to get player who get blinded by flashbang.
Then change player propertie "m_flFlashDuration"
PHP Code:

new Float:duration GetEntPropFloat(clientProp_Send"m_flFlashDuration");
duration += 5.0// 5 seconds longer blind
SetEntPropFloat(clientProp_Send"m_flFlashDuration"duration); 


josegold 02-19-2014 11:52

Re: [CS:S] Flashbang Tools
 
This came to me helpfully, good

Schneemann 02-22-2014 13:40

Re: [CS:S] Flashbang Tools
 
Hello:)
I use this plugin in combination with Trikz Redux 1.7.2 and get some trouble.
little question, the server always crash after I toggled "auto flash", or/and "auto switch".

Sourcemod version: 1.6.0-hg4254 (tested with sm v. 1.5.3-hg3997 too)
Timer 2.0.6 fixed
Trikz Redux 1.7.2
Flashbang Tools: Flashbang Tools 0.0.3 & newst gamedata

Till now, I didn't found any solution for my problem.

Greetz
Schnee

poppin-fresh 04-20-2014 05:35

Re: [CS:S] Flashbang Tools
 
Hey, Todays update has seemed to break the plugin. I've updated sourcemod so it must be gamedata? This still works fine on my linux (debian) server but seems to be broken on windows

L 04/20/2014 - 17:19:05: [CSTRIKE] Sigscan for TerminateRound failed - Disabling detour to prevent crashes
L 04/20/2014 - 17:19:05: [CSTRIKE] TerminateRound detour could not be initialized - Disabled OnTerminateRound forward
L 04/20/2014 - 17:19:05: [FBTOOLS] Sigscan for CFlashbangProjectile::Detonate failed - Disabling detour to prevent crashes
L 04/20/2014 - 17:19:05: [FBTOOLS] CFlashbangProjectile::Detonate detour could not be initialized - Disabled OnFlashDetonate forward

shavit 04-21-2014 09:46

Re: [CS:S] Flashbang Tools
 
Can we get a gamedata update?

Marcos 05-17-2014 04:48

Re: [CS:S] Flashbang Tools
 
Need update cs:s gamedata.
Code:

L 05/17/2014 - 16:40:07: [FBTOOLS] Sigscan for CFlashbangProjectile::Detonate failed - Disabling detour to prevent crashes
L 05/17/2014 - 16:40:07: [FBTOOLS] CFlashbangProjectile::Detonate detour could not be initialized - Disabled OnFlashDetonate forward
L 05/17/2014 - 16:40:07: [FBTOOLS] Sigscan for PercentageOfFlashForPlayer failed - Disabling detour to prevent crashes
L 05/17/2014 - 16:40:07: [FBTOOLS] PercentageOfFlashForPlayer detour could not be initialized - Disabled OnGetPercentageOfFlashForPlayer forward


Dr!fter 05-17-2014 10:27

Re: [CS:S] Flashbang Tools
 
1 Attachment(s)
ur

Marcos 05-17-2014 19:44

Re: [CS:S] Flashbang Tools
 
Quote:

Originally Posted by Dr!fter (Post 2139016)
ur

Thank you.

Despirator 07-05-2014 05:22

Re: [CS:S] Flashbang Tools
 
new gamedata?

falafili 10-27-2014 13:49

Re: [CS:S] Flashbang Tools
 
Quote:

Originally Posted by Dr!fter (Post 2139016)
ur


Can we get a new gamedata update, especially for linux os?

Rop 01-18-2015 15:21

Re: [CS:S] Flashbang Tools
 
Waiting for an update, the Trikz plugin is useless right now untill we get an update from here

L 01/18/2015 - 21:15:53: [SM] Unable to load extension "flashtools.ext": /lib/i386-linux-gnu/i686/cmov/libm.so.6: version `GLIBC_2.15' not found (required by bin/libvstdlib.so)
L 01/18/2015 - 21:15:53: [SM] Unable to load plugin "trikz_redux.smx": Required extension "flashtools" file("flashtools.ext") not running

george. 02-22-2015 12:22

Re: [CS:S] Flashbang Tools
 
Quote:

Originally Posted by Rop (Post 2250829)
Waiting for an update, the Trikz plugin is useless right now untill we get an update from here

L 01/18/2015 - 21:15:53: [SM] Unable to load extension "flashtools.ext": /lib/i386-linux-gnu/i686/cmov/libm.so.6: version `GLIBC_2.15' not found (required by bin/libvstdlib.so)
L 01/18/2015 - 21:15:53: [SM] Unable to load plugin "trikz_redux.smx": Required extension "flashtools" file("flashtools.ext") not running

EDIT:
So the solution to the problem should be
using the so files contained in http://security.ubuntu.com/ubuntu/po...u10.9_i386.deb

the gmod wiki provides this bash script for doing so:
Code:

wget http://security.ubuntu.com/ubuntu/pool/main/e/eglibc/libc6_2.15-0ubuntu10.9_i386.deb
dpkg -x libc6_2.15-0ubuntu10.9_i386.deb tmp/
cd tmp/lib/i386-linux-gnu/
cp * /your-garrysmod-directory/bin/

And yes, the error happens on gmod for a different reason unrelated to sourcemod (the games binaries were compiled on a newer glibc itself). But if you have this issue on linux the so files in the package above should solve the issue (atleast on debian/ubuntu for other distributions you may have to find different libararies - not sure on this can anyone confirm?)

New signatures:

Code:

"Games"
{
        "cstrike"
        {
                "Signatures"
                {
                        "Deafen"
                        {
                                "library"                "server"
                                "windows"                "\x55\x8B\xEC\x83\xEC\x28\x89\x4D\xFC\x8B\x45\xFC\x8B\x10"
                                "linux"                        "@_ZN9CCSPlayer6DeafenEf"
                        }
                        "CFlashbangProjectile::Detonate"
                        {
                                "library"                "server"
                                "windows"                "\x53\x56\x8B\xF1\x57\x8B\x86\x00\x01\x00\x00\xC1\xE8\x0B\xA8\x01\x74\x2A\xE8\x2A\x2A\x2A\x2A\xD9\x05\x2A\x2A\x2A\x2A"
                                "linux"                        "@_ZN20CFlashbangProjectile8DetonateEv"
                        }
                        "PercentageOfFlashForPlayer"
                        {
                                "library"                "server"
                                "windows"                "\x53\x8B\xDC\x83\xEC\x08\x83\xE4\xF0\x83\xC4\x04\x55\x8B\x6B\x04\x89\x6C\x24\x04\x8B\xEC\x81\xEC\x2C\x01\x00\x00\x56\x8B\x73\x08\x8D\x4D\xAC"
                                "linux"                        "@_Z26PercentageOfFlashForPlayerP11CBaseEntity6VectorS0_"
                        }

                }
        }
}

Only did them for css because I don't have the binaries for csgo and am too lazy to get them. (Thanks to ici for correcting me before I posted them here too)

ici 02-23-2015 17:14

Re: [CS:S] Flashbang Tools
 
Here's the detonate signature for csgo. I couldn't find the other two, sorry.

Code:

"CFlashbangProjectile::Detonate"
{
        "library"                "server"
        "windows"                "\x55\x8B\xEC\x83\xEC\x6C\x53\x56\x8B\xF1\x8B\x0D\x2A\x2A\x2A\x2A"
        "linux"                        "@_ZN20CFlashbangProjectile8DetonateEv"
}

You could still use it for your csgo trikz server though.

PHP Code:

#include <sourcemod>
#include <sdktools>
#include <flashtools>

public Action:OnFlashDetonate(entity)
{
    
AcceptEntityInput(entity"kill");
    return 
Plugin_Handled;



Gioy 03-31-2015 16:33

Re: [CS:S] Flashbang Tools
 
hi all, anyone can help me to install this tools?? I have installed the flashtools 0.0.3, the problem is: my server don't load trikz plugin because is required the flashtools.ext...

[SM] Plugin trikz_redux.smx failed to load: Required extension "flashtools" file("flashtools.ext") not running.

please anyone help me?? :cry:
tnx.
sry for my bad english


All times are GMT -4. The time now is 08:40.

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