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

[CS:S] Flashbang Tools


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 06-22-2011 , 20:08   [CS:S] Flashbang Tools
Reply With Quote #1

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

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.
Attached Files
File Type: zip flashbang-tools-src.zip (24.6 KB, 1918 views)
File Type: zip flashtools-0.0.3.zip (57.1 KB, 2970 views)

Last edited by Dr!fter; 08-16-2012 at 12:32.
Dr!fter is offline
 



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 05:44.


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