PDA

View Full Version : WhoBangedMe?: Source!


Shaman
07-28-2007, 13:21
WhoBangedMe?: Source!

Current Version: 0.0.5 (Translation v6)

Available Languages:

English
Turkish
German (Thanks to -<[PAGC]>- Isias (http://forums.alliedmods.net/member.php?u=16590))
Swedish (Thanks to Lindgren (http://forums.alliedmods.net/member.php?u=28846)) (Old)

Description:
This tiny plugin tells the players who throw the flashbang to blinded players.

CVar's:
whobangedmesource_enable - Enables/disables WhoBangedMe?: Source
whobangedmesource_tmonly - Tell to teammates only.
whobangedmesource_tmbanglimit - Teammate bang punishment limit. (0 disables punishment.)

http://img108.**************/img108/3450/admintoolssupportedop0.png
Do not click "Get Plugin". Use the ".smx" instead.

sumguy14
07-28-2007, 13:32
Love the name.. lol
Cool plugin, keep it up ;)

Shaman
07-28-2007, 13:43
Thanks! The name is really interesting :D

X-Script
07-28-2007, 17:44
Very usefull plugin.

Good job.

Isias
07-29-2007, 11:45
This is great! German Translation added.

Lindgren
07-29-2007, 13:04
Swedish translation added.

Shaman
08-01-2007, 10:46
Approve this super plugin please!
Edit: This should be a core plugin :o

Shaman
08-02-2007, 05:24
Version v0.0.1b released:
Files included:
scripting/whobangedmesource.sp
translations/whobangedmesource.base.txt
Added files: None
Changed files:
scripting/whobangedmesource.sp
translations/whobangedmesource.base.txt
Release Notes:
Still needs some tests.
Changes:
Removed message displayed when WhoBangedMe?: Source not active.
Removed unnecessery code.
Optimized functions to work a little bit faster.
Fixed a problem which caused wrong names to be displayed.

Lindgren
08-13-2007, 05:21
Updated swedish translation

Isias
08-13-2007, 07:41
Updated german translation

Shaman
08-13-2007, 10:07
Updated translation file in the first post.
Thanks again:up:

Falco
08-15-2007, 21:13
L 08/15/2007 - 19:10:07: [SM] Native "GetClientTeam" reported: Client index 0 is invalid
L 08/15/2007 - 19:10:07: [SM] Displaying call stack trace for plugin "whobangedmesource.smx":
L 08/15/2007 - 19:10:07: [SM] [0] Line 130, /home/groups/alliedmodders/forums/files/2/3/2/9/2/18650.attach::Event_PlayerTeam()

I keep getting this in my error logs. Running current version.

Shaman
08-16-2007, 07:34
New version v0.0.2b

Files included:
C|scripting/whobangedmesource.sp
S|translations/whobangedmesource.base.txt
Release Notes:
Ready to go.
Changes:
Removed unnecessery code.
Optimized functions.
Fixed a problem which caused 'Native "GetClientTeam" reported: Client index 0 is invalid' error.

@Falco:
I hope this solves your problem.

Falco
08-16-2007, 13:14
Brilliant, thanks for the fix. Error is gone.

Shaman
08-20-2007, 07:53
New version v0.0.4:
Files included:
C|scripting/whobangedmesource.sp
S|translations/whobangedmesource.base.txt
Release Notes:
From now on SStocks is required to compile this plugin.
Changes:
Removed 'sm_' prefix from ConVars.

Spacey
08-26-2007, 14:48
Too bad it isn't working correctly for me :(
It doesn't show the correct names who banged who.

Examples: I'm flashed by someone else but it writes: You banged yourself.
Or it shows a name of someone who's already dead as a banger...

Isias
08-28-2007, 13:41
Updated Translation for last Version (if you banged yourself textblock)"de" "You banged yourself!"->"de" "Du hast dich selbst geflasht!"

Gryzel
08-31-2007, 15:49
:shock:
Plugin failed to compile! Please try contacting the author.
Some improvement may need

Shaman
09-05-2007, 06:17
Plugin needs SStocks to compile.

urus
09-09-2007, 18:46
It will be nice if you add kill player who flashed more than X teammates. For base flashers example.

Х is defined by cvar.

xYx
09-18-2007, 08:13
It will be nice if you add kill player who flashed more than X teammates. For base flashers example.

Х is defined by cvar.

This would be extremely useful & would stop those idiots that teamflash at spawn.

Please please please please can you do this?

*One more final beg to do this*


:)

Shaman
09-18-2007, 10:28
I coded that, but I need more time to make tests. I am very busy these days.

xYx
09-18-2007, 11:06
Brilliant news!!

I understand you are working on alot of plugins. Any chance you could post up the latest version as a beta so we can test?

Im super eager to get this feature :D

Shaman
09-18-2007, 11:56
Don't forget to use the new translation file. Plugin counts and displays warnings. If the limit is reached (defined by a ConVar) the player will be slain. I will add kick option later.

xYx
09-22-2007, 08:57
lo,

Thanks for releasing this beta to us!!

I now have had a chance to test this today.

There are a couple of issues/ recommendations I have.

1) If I throw a flash & it hits a teammate before it explodes, the team mate I team attack gets slayed and not me. MY mate thaught this was really funny and tried to do this all map. I didnt find it so funny as i was slayed all the time instead of him :p

2) Would it be possible to set a timelimit for the slay - more like a spawn pretection. For example; it would slay you for team flashing 3 teammates upto 10 seconds after spawn. After the 10 seconds it doesnt slay anymore only warns you through chat?

Hope my testing helps :S This is one of the most useful plugins for sourcemod.

Thank you

xYx

Shaman
09-23-2007, 07:45
Hmm. It is really intresting. I will check the code again. I hope I can solve the issue.

I don't hook anything about attacks. I hook only "flashbang_detonate" and "player_blind". Maybe I accidently mixed attacker and victim somewhere.

Thanks for your report.

Edit:
I tested it and it works. I took a video with Fraps too, but its 146mb.

xYx
09-23-2007, 16:04
lo thanks for getting back to me.

So, you experience the flash bang hitting ur team mate and slaying them instead of you?

Shaman
09-25-2007, 11:12
No, but I tested with 2 bots. I will test again with one bot.

graczu
10-25-2007, 07:38
This plugin rulez, i added some changes for my serer, and i sharing the source.

I added:

* Checking if attacker or victim is not a ID 0
* Added maxteambangs (cvar = whobangedmesource_max), if somone will get more team flashbangs that is set in this svar, player will be kick.
* If "cvar = whobangedmesource_max" = 0, it's off.
* sstock not need
* Plugin Message are displayed in console, to dont get flood on chat.

http://paste.hopto.org/index.php?47

Shaman
10-25-2007, 14:22
New version v0.0.5:
Files included:
C|scripting/whobangedmesource.sp
C|translations/whobangedmesource.base.txt
Release Notes:
None.
Changes:
Fixed 'tmonly' mode.
Added teammate bang punishment.
This version doesn't kick players. It just slays.

doa
11-12-2007, 09:22
I think this is a great plugin and I am sure it will reduce alot of teamflash!
But... it's not working.. :cry:
Looks like the last person that was touched by the flash will become the "owner" of the flash and will be accused of teamflashing.

GriMz
11-19-2007, 05:14
Don't forget to use the new translation file. Plugin counts and displays warnings. If the limit is reached (defined by a ConVar) the player will be slain. I will add kick option later.

and what is the convar? you never explained that.

this is slaying the wrong ppl :(
maybe disable the autoslay?

Shaman
11-27-2007, 11:26
I can't find the problem! I tried with bots and it works right. Maybe real players cause this problem. I will update my installation and check if I can do something else.

Edit:
You can disable punishment by setting "whobangedmesource_tmbanglimit" to "0".

doa
11-27-2007, 18:25
I can't find the problem! I tried with bots and it works right. Maybe real players cause this problem. I will update my installation and check if I can do something else.


Yeah, works fine on bots. I tried it out using bots as well, but it banged out big time when used with non-bots.
Hope you manage to sort it out man, this will be a great plugin if it works!

Grrrrrrrrrrrrrrrrrrr
12-03-2007, 16:37
Try the following steps:

1. flashbang_detonate gives you the origin. So, save the origin and the player who the flash bang belongs to. (e.g. lastbanger , lastbangerorigin)

2. Now, there must be some kind of max distance for looking at a flashbang's flash. I think its "m_fadeMaxDist" from "CFlashbang." So, you should find this value before the flash bang detonates.

3. when a player is blinded check the distance (http://docs.sourcemod.net/api/index.php?fastload=show&id=547&) between the player's origin (http://docs.sourcemod.net/api/index.php?fastload=show&id=429&) and the flashbang_detonate origin. And, if the distance is below "m_fadeMaxDist" give credit.

Please tell me if it works.

Shaman
12-04-2007, 08:12
What about walls?

Grrrrrrrrrrrrrrrrrrr
12-04-2007, 20:01
This is the same thing as your original version with a small add on. Now it checks to make sure the player is with in the max distance of the flash bang flash.

Still, the is only a temporary solution. There must be a better way.

Shaman
12-06-2007, 14:07
Maybe I can try to get entity index of the throwed and exploaded flashbang and do this:

OnThrow
{
if(fbangs[entityindex]==0)
{
fbangs[entityindex]= thrower
}
}
OnExplode
{
thrower= fbangs[entityindex]
fbangs[entityindex]= 0
}

But, how can I get the index of the flashbang in "OnThrow" and "OnExplode"?

Grrrrrrrrrrrrrrrrrrr
12-07-2007, 14:38
I do not fully understand what you are trying to do. From what I understand about what you said, your plan doesn't really make sense.

Anyways, this is what your trying to do:
public Event_Fire(Handle:event, const String:name[], bool:dontBroadcast)
{
new clientId = GetEventInt(event, "userid")
new client = GetClientOfUserId(clientId)

new String:weapon[30]
GetEventString(event, "weapon", weapon, sizeof(weapon))

if (!StrEqual(weapon,"flashbang"))
return

CreateTimer(0.1, timer, client)
}

public Action:timer(Handle:timer, any:client)
{
new ent = -1
new lastent
new owner

ent = FindEntityByClassname(ent, "hegrenade_projectile")

while (ent != -1)
{
owner = GetEntPropEnt(ent, Prop_Send, "m_hThrower")

if (IsValidEntity(ent) && owner == client)
break

ent = FindEntityByClassname(ent, "hegrenade_projectile")

if (ent == lastent)
{
ent = -1
break
}

lastent = ent
}

if (ent != -1)
{
fbangs[ent] = client
}
}* say thanks to pRED*.

Bloodlvst
12-07-2007, 14:43
Grrrrrrrrrrrrrrrrrrr (http://forums.alliedmods.net/member.php?u=32056) Are you saying that the new code works? If so, SEX ME PLZ! vbmenu_register("postmenu_560880", true);

Grrrrrrrrrrrrrrrrrrr
12-07-2007, 23:23
NO - the current code is a failure. What I am saying is that my idea in post #35 would make the plugin work.

Currently, Shaman (http://forums.alliedmods.net/member.php?u=23292) is trying to implement my idea (I think) and I'm helping him.

@Shaman (http://forums.alliedmods.net/member.php?u=23292): Quick Notes:
1. Shouldn't this:
new Handle:data;
CreateDataTimer(0.1, WhoBangedWho, data);
WritePackCell(data, victim);
WritePackCell(data, lastbanger);
be like this:

new Handle:data;
WritePackCell(data, victim);
WritePackCell(data, lastbanger);
CreateDataTimer(0.1, WhoBangedWho, data);


2.Shouldn't this:
if(!(BConVar("tmonly") && GetClientTeam(victim)!=GetClientTeam(attacker )))
Be like this:
if(!BConVar("tmonly") && GetClientTeam(victim)!=GetClientTeam(attacker ))

Bloodlvst
12-08-2007, 01:02
Yeah that's what I meant, I was talking about your code! :)

Shaman
12-08-2007, 06:17
Grrrrrrrrrrrrrrrrrrr:
I don't know why, but #1 only works in that way. Now, I can't say anything about #2 and post #39. I will take a look at the code when I go home.

Edit:
I changed #2 to this:
//Send the message if we can
if(!BConVar("tmonly") || (BConVar("tmonly") && GetClientTeam(victim)==GetClientTeam(attacker )))
MessageToOne(victim, PLUGIN_NAME, "%t", "WBMS BangedBy", attacker_name);

Grrrrrrrrrrrrrrrrrrr
12-08-2007, 15:58
You should add one more thing to #2: (you use GetClientTeam more then once for both players and that wasts resources)

new vteam = GetClientTeam(victim);
new ateam = GetClientTeam(attacker);
//Is our attacker banged a teammate?
if(vteam==ateam)
TMbang(attacker);
//Send the message if we can
if(!BConVar("tmonly") || (BConVar("tmonly") && vteam==ateam))
MessageToOne(victim, PLUGIN_NAME, "%t", "WBMS BangedBy", attacker_name); Otherwise, it is perfect.

EDIT:
FOUND THE PROBLEM (i think)
Recently, ferret explained details about how hooking works to me and this should also explain why your plugin does not work (explanation (http://forums.alliedmods.net/showpost.php?p=560628&postcount=12)). After pondering for sometime, I think I came up with an actual solution and not a guess.
The solution break down:
1. On "weapon_fire," get "m_fThrowTime" from the "flashbang_projectile" and add it to "GetGameTime" which will be a float.
2. On "player_blind," get GetGameTime and see if its equal to the above float or within a certain amount of milliseconds (try 0.2 seconds. If that does not work, just find 0.2 in the script and change it to a higher or lower value).

I wrote the script quickly, but you should look it over and test it.

lijpe frits
12-11-2007, 11:10
any idea how to make this plugin work? got the plugin from above this post, its running but doesnt do anything!

any help appreciated !

Shaman
12-11-2007, 11:41
Download from the first post.

Bloodlvst
12-11-2007, 11:42
Download from the first post.

So your plugin now works on real players and not just bots? :D

Shaman
12-11-2007, 12:14
Just disable punishments. It's experimental.

Bloodlvst
12-11-2007, 12:24
I meant the messages saying who got flashed :)

Shaman
12-11-2007, 13:30
Don't they work?

Bloodlvst
12-11-2007, 13:33
They didn't, but I had modified it. Then I saw people saying it didn't work so yeah. I probably just screwed it up. I'll test the original one tonight hehe. ;)

lijpe frits
12-12-2007, 09:18
The files from the first post also not working for me. i have set tm_banglimit to 0

bawitdaba
01-13-2008, 20:26
this mod works and works pretty well, except it doesn't always show the correct teammate/flasher that flash banged you. Our server had bots when we were testing and im not sure if this effects this mod or not..

Isias
08-18-2008, 08:57
Updated german translation - see attachment

haderlump
09-17-2008, 07:55
i love that the server can auto-punish teamflashers now!
(like when a guy joins and buys/throws 15 flashes at round start - grr!)

but does the punish increment by the flash thrown or the number
of people it registers as affected?

like if i set the punish cvar to 16,
is that 16 flashbangs?
or, is is 2 flash bangs blinding the whole team of 8 two times?

also, what is a suggested setting for this?
i want it to punish the guy that is trying to blind out his teammates
repeatedly over a period of 30-35 rounds on dust2,
not affect a guy that is just collaterally accumulating some
buddy-blinds (sometimes i blind my teammates to protect them
from death when i see they are in a bad spot -- like when you
can come in and get a kill that saves them while they are blind.
they still usually get pissed as they dont realize you killed a
guy just about to lay them out but that is life...)

mabu
10-24-2009, 03:56
show it selfflashes too ?

mabu
10-24-2009, 09:27
could you add the time, how long are a player is blind ? :)

CS:S*
10-29-2009, 22:14
Errors :

L 10/30/2009 - 04:11:32: Error log file session closed.
L 10/30/2009 - 04:12:42: SourceMod error session started
L 10/30/2009 - 04:12:42: Info (map "de_dust2") (file "errors_20091030.log")
L 10/30/2009 - 04:12:42: [SM] Native "GetClientTeam" reported: Client index 0 is invalid
L 10/30/2009 - 04:12:42: [SM] Displaying call stack trace for plugin "whobangedmesource.smx":
L 10/30/2009 - 04:12:42: [SM] [0] Line 180, whobangedmesource.sp::WhoBangedWho()


Compile errors :

//// whobangedmesource.sp
// D:\srcds\cstrike\addons\sourcemod\scripting\i nclude\sstocks.inc(39) : warning
201: redefinition of constant/macro (symbol "MAX_NAME_LENGTH")
// Header size: 2516 bytes
// Code size: 2700 bytes
// Data size: 1276 bytes
// Stack/heap size: 16384 bytes; Total requirements: 22876 bytes
//
// 1 Warning.
//
// Compilation Time: 0,59 sec

Can someone fix this plugin pls :(

Shaman
01-10-2010, 06:03
Errors :

L 10/30/2009 - 04:11:32: Error log file session closed.
L 10/30/2009 - 04:12:42: SourceMod error session started
L 10/30/2009 - 04:12:42: Info (map "de_dust2") (file "errors_20091030.log")
L 10/30/2009 - 04:12:42: [SM] Native "GetClientTeam" reported: Client index 0 is invalid
L 10/30/2009 - 04:12:42: [SM] Displaying call stack trace for plugin "whobangedmesource.smx":
L 10/30/2009 - 04:12:42: [SM] [0] Line 180, whobangedmesource.sp::WhoBangedWho()
Compile errors :

//// whobangedmesource.sp
// D:\srcds\cstrike\addons\sourcemod\scripting\i nclude\sstocks.inc(39) : warning
201: redefinition of constant/macro (symbol "MAX_NAME_LENGTH")
// Header size: 2516 bytes
// Code size: 2700 bytes
// Data size: 1276 bytes
// Stack/heap size: 16384 bytes; Total requirements: 22876 bytes
//
// 1 Warning.
//
// Compilation Time: 0,59 secCan someone fix this plugin pls :(
I fixed the error on the first quote. The error on the second quote is probably from an old version of SStocks. It compiles without any warnings in the latest version.

Edit:
I didn't change the version or the change logs. Just download it again...

musosoft
01-21-2010, 16:34
01/21/2010 - 22:26:58: [SM] Native "GetClientName" reported: Client 3 is not connected
L 01/21/2010 - 22:26:58: [SM] Displaying call stack trace for plugin "whobangedmesource.smx":
L 01/21/2010 - 22:26:58: [SM] [0] Line 181, D:\Projects\DevKit\whobangedmesource\whobange dmesource.sp::WhoBangedWho()
L 01/21/2010 - 22:26:58: [SM] Native "GetClientName" reported: Client 3 is not connected
L 01/21/2010 - 22:26:58: [SM] Displaying call stack trace for plugin "whobangedmesource.smx":
L 01/21/2010 - 22:26:58: [SM] [0] Line 181, D:\Projects\DevKit\whobangedmesource\whobange dmesource.sp::WhoBangedWho()

Anyone can help me solve that error? Thanks (I downloaded .smx from attachment today)

edit: Can this cause FakeClients?

lindo81
07-28-2010, 20:08
@ Shaman (http://forums.alliedmods.net/member.php?u=23292) ,please make it with the option for admins only and to tell the admins who bangs team-mates please ,would you ?

Arcy
11-23-2010, 06:32
Why does it show wrong names any1 know? any1 can fix this?

nightrider
11-28-2010, 17:21
I also get this error.

adamnp
04-23-2011, 11:53
Can anyone verify if this still works? I've been unable to verify, but don't see any screenshots posted so unsure what I am looking for :} haha

cssnik
09-10-2011, 13:03
Add a slap instead of slay how in this plugin FlashProtect (http://forums.alliedmods.net/showthread.php?p=843342)

Doezer
01-19-2012, 04:53
French version added.