AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SOLVED]Players flashed (https://forums.alliedmods.net/showthread.php?t=57313)

Alka 07-02-2007 08:52

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

Thanks

purple_pixie 07-02-2007 09:11

Re: Players flashed
 
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.

Alka 07-02-2007 10:27

Re: Players flashed
 
Yeah...i know that event! But,i must know the thrower and alot of other things...:|

Zenith77 07-02-2007 10:51

Re: Players flashed
 
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.

Alka 07-02-2007 11:20

Re: Players flashed
 
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;

stupok 07-02-2007 14:34

Re: Players flashed
 
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) }

Alka 07-02-2007 15:32

Re: Players flashed
 
Quote:

Originally Posted by stupok69 (Post 497639)
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 :wink:

EDIT:Problem solved! ;) Thanks


All times are GMT -4. The time now is 21:23.

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