Raised This Month: $ Target: $400
 0% 

[SOLVED]Players flashed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 07-02-2007 , 08:52   [SOLVED]Players flashed
Reply With Quote #1

Hi.Is there a way to get players flashed from a flashbang nade?
*E.g : 2 player flashed! (Message showed to thrower)

Thanks
__________________
Still...lovin' . Connor noob! Hello

Last edited by Alka; 07-02-2007 at 20:24.
Alka is offline
purple_pixie
Veteran Member
Join Date: Jun 2007
Location: Winchester, England
Old 07-02-2007 , 09:11   Re: Players flashed
Reply With Quote #2

Without sounding *too* unhelpful you would probably want to calculate who should be flashed by it, rather than trying to get who actually was.

No, wait - sod that, this must be quite possible; one of the servers I play on has a sound effect for when you get flashed so there must be an event there somewhere.

EDIT: See V3x's "Colored Flashbangs" mod - http://forums.alliedmods.net/showthread.php?t=15241

The source is very small, and you should be able to work something out from that.

Last edited by purple_pixie; 07-02-2007 at 09:37.
purple_pixie is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 07-02-2007 , 10:27   Re: Players flashed
Reply With Quote #3

Yeah...i know that event! But,i must know the thrower and alot of other things...
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 07-02-2007 , 10:51   Re: Players flashed
Reply With Quote #4

All this info is located in other plugins (the very reason why this is open source community). I'll sum it up for you:

1) Hook fire in the hole sound.
2) Get grenade, then by model figure out what kind of grenade it is.
3) The owner of that grenade is obviously the thrower.
4) Hook a flash event, these are the "victims" of the nade. Somehow get what grenade fired the message.
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 07-02-2007 , 11:20   Re: Players flashed
Reply With Quote #5

Hum...i will give a try! Thx .

EDIT:I tried something but i dunno if is my nade & i don't want to use csx!

Principle:
-Throw nade(flash);
-When explode print to thrower how many ppl has flashed;
-If you get flashed by you'r self don't count;
__________________
Still...lovin' . Connor noob! Hello

Last edited by Alka; 07-02-2007 at 11:41.
Alka is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 07-02-2007 , 14:34   Re: Players flashed
Reply With Quote #6

I think this will work, but you still have to figure out who threw the flashbang:

(Maybe there's a better way, using set_task() is a bit fishy.)

EDIT: Nevermind, I just realized this is a really crappy way to do what you're looking for. It's gonna print a message for every person that's flashed, so that's dumb. I'll leave it up anyways.

Code:
#include <amxmodx> #define PLUGIN  "Flash Victims" #define VERSION "1.0" #define AUTHOR  "stupok69" #define MAX_PLAYERS 32 new bool:has_been_flashed[MAX_PLAYERS+1] public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_event("ScreenFade", "FlashedEvent", "be", "4=255", "5=255", "6=255", "7>199") // ty v3x } public client_connect(id)     has_been_flashed[id] = false public FlashedEvent(id) {     has_been_flashed[id] = true     set_task(0.1, "display_flashed") } public display_flashed() {     new count         for(new i = 1; i < MAX_PLAYERS+1; i++)     {         if(has_been_flashed[i])         {             count++             has_been_flashed[i] = false         }     }     client_print(0, print_chat, "%i people have been flashed", count) }

Last edited by stupok; 07-02-2007 at 14:45.
stupok is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 07-02-2007 , 15:32   Re: Players flashed
Reply With Quote #7

Quote:
Originally Posted by stupok69 View Post
Nevermind, I just realized this is a really crappy way to do what you're looking for. It's gonna print a message for every person that's flashed, so that's dumb. I'll leave it up anyways.
Yeah i know... but thanks

EDITroblem solved! ;) Thanks
__________________
Still...lovin' . Connor noob! Hello

Last edited by Alka; 07-02-2007 at 20:24.
Alka 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 21:23.


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