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

Create a fake flashbang explosion


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
necavi
Veteran Member
Join Date: Sep 2010
Old 03-24-2012 , 02:23   Create a fake flashbang explosion
Reply With Quote #1

I have tried using TR_TraceRay(), but unfortunately I don't know how to use it correctly despite much variation, not to mention that creating an actual flashbang explosion would be far better, but I have not been able to figure out quite how to do that yet. Any help in this matter would be greatly appreciated.
necavi is offline
blodia
Veteran Member
Join Date: Sep 2009
Location: UK
Old 03-24-2012 , 09:20   Re: Create a fake flashbang explosion
Reply With Quote #2

this works for he grenades so it might work for flashbangs as well. create a "flashbang_projectile" and spawn it wherever, set "m_takedamage" to 2 so it can take damage, set "m_iHealth" to 1 then use sdkhooks takedamage native to damage the entity for 1 damage which will destroy it in turn detonating it. for the flashbang you may need to set "m_flDamage" to adjust the falloff.
blodia is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 03-24-2012 , 12:25   Re: Create a fake flashbang explosion
Reply With Quote #3

Couldn't you just send an event to the server? put in the xyz you want the bang to go off at, set the client_id to 0 maybe for console... or maybe you want to do something else or I don't understand and am just talking out of the side of my neck or something

http://wiki.alliedmods.net/Events_(S...Sending_Events

Code:
DetonateFlashBang(client, Float:x,  Float:y, Float:z) {     new Handle:event = CreateEvent("flashbang_detonate");     if (event == INVALID_HANDLE)     {         return;     }       SetEventInt(event, "userid", GetClientUserId(client)); // or maybe just 0 for console     SetEventFloat(event, "x", x);     SetEventFloat(event, "y", y);     SetEventFloat(event, "z", z);     FireEvent(event); }
__________________
View my Plugins | Donate

Last edited by TnTSCS; 03-24-2012 at 12:51.
TnTSCS is offline
Lord Canistra
Senior Member
Join Date: Mar 2009
Location: Tallinn, Estonia
Old 03-24-2012 , 12:39   Re: Create a fake flashbang explosion
Reply With Quote #4

Events are echoes of something that already happened. They do not alter the game state, but are just means of spreading the message that something changed. So I doubt that creating fake flashbang event would cause a real flashbang explosion appear in-game, both on server and clients.
__________________
Lord Canistra is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 03-24-2012 , 12:59   Re: Create a fake flashbang explosion
Reply With Quote #5

ah, that's right - that event is post a real flashbang and not a method to create one

Maybe this extension can be enhanced to create a flashbang - http://forums.alliedmods.net/showthread.php?p=1493858
__________________
View my Plugins | Donate

Last edited by TnTSCS; 03-24-2012 at 13:12.
TnTSCS is offline
RedSword
SourceMod Plugin Approver
Join Date: Mar 2006
Location: Quebec, Canada
Old 03-25-2012 , 15:50   Re: Create a fake flashbang explosion
Reply With Quote #6

You might want to check http://forums.alliedmods.net/showthr...t=fake+grenade

He was trying to do the same; but for L4D and a grenade. It doesn't seem he got it to work (I really don't know), but there is a bunch of entity creation stuff that you might want to check.
__________________
My plugins :
Red Maze
Afk Bomb
RAWR (per player/rounds Awp Restrict.)
Kill Assist
Be Medic

You can also Donate if you appreciate my work
RedSword 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 18:40.


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