AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Kill assist (for CS) (https://forums.alliedmods.net/showthread.php?t=91360)

Hunter-Digital 04-30-2009 05:50

Kill assist (for CS)
 
1 Attachment(s)
Kill assist v1.2b (for CS)
Author: Digi (aka Hunter-Digital)

Description:
When a player gets killed, this plugin checks if another player, from the same team, did enough damage to the victim so that he could be an accomplice to the kill and the assister will also receive a frag (all of these are cvar controlled)

Configuration variables and default values:
- amx_killassist_enable 0/1/2 (default: 1)
Enable modes: 0 = Disable / 1 = Enable with DeathMsg / 2 = Enable with HUD message

- amx_killassist_mindamage 1-9999 (default: 50)
Minimum amount of damage to deal to be nominated for an assisted kill

- amx_killassist_givefrags 0/1 (default: 1)
Give or not give the assister frags

- amx_killassist_givemoney 0-16000 (default: 300)
Give or not give the assister some money, 0 disables, 1 or more sets how much money

- amx_killassist_onlyalive 0/1 (default: 0)
Only alive players can be of assistance in killing other players

Modules required:
- hamsandwich
- cstrike
- engine
- fun

Credits and thanks:
- ConnorMcLeod - for helping with quick name changing
- arkshine - for helping with name squeeze
- joaquimandrade - code improvements
- anakin_cstrike - code improvements
- Nextra - more code improvements
- ajvn - some ideas
- Dores - and more code improvements
- frearmer - hud message sugestion

Some screenshots:
[IMG]http://img253.**************/img253/4124/14436808.jpg[/IMG]
[IMG]http://img403.**************/img403/1954/40100193.jpg[/IMG]
[IMG]http://img299.**************/img299/9150/81448149.jpg[/IMG]

(sorry about the botlike names xD :lol: )

That's all, hope you guys like it :P
and if it's a good ideea I'll work on improving it, less modules, less module comunications and so on :}

People who want to make this (or help me in making it) for other mods are free to do so :)

Changelog:
v1.2b - modified public variable to "killassist_version" and fixed deathmsg not showing when you suicide with worldspawn or an entity
v1.2 - added no-name-changing support, prints HUD message, to activate, set enabled to 2
v1.1b - simplified cvar checking using clamp()
v1.1 - converted to CS only, new cvars: amx_killassist_onlyalive, amx_killassist_givemoney, enriched cvar handling, added team cache and fixed some bugs
v1.0d - Removed useless stuff xD, added pcvar on amx_mode and used formatex()
v1.0c - Some modifications and added g_bOnline
v1.0b - Fixed admin name bug
v1.0 - Release

Servers using Kill Assist:
version < 1.2b
version 1.2b+


This plugin can be compiled via Web Compiler (aka "Get Plugin")

EvolDay 04-30-2009 05:54

Re: Kill assist
 
Nice seems like a cool thing i can add to my pub, ill try it out tomorrow. Thanks :)

xPaw 04-30-2009 06:24

Re: Kill assist
 
holy fck! thats nice!

shine771 04-30-2009 06:26

Re: Kill assist
 
I was making this a while ago. GJ. The reason why i didn't finish it was because i didn't think about a delay after set_user_info. :). I just couldn't get it to work.

Simax 04-30-2009 06:31

Re: Kill assist
 
Cool, test it :D

alan_el_more 04-30-2009 07:38

Re: Kill assist
 
Sounds cool, Nice Job!!! :up:

Dr.G 04-30-2009 08:23

Re: Kill assist
 
cool, ill check this on dod, gj what ever the result is..

Hunter-Digital 04-30-2009 08:43

Re: Kill assist
 
Pffffff, big fricken bug :<... when a player's name will be changed that contains an admin's name he's kicked before he can change his name back... damn, I was SURE I'll have a big fricken error like his... anyone know how to block the check for admin or something ? :(

Dr.G 04-30-2009 08:46

Re: Kill assist [to be fixed...]
 
didnt work for dod. all death messages were just blocked

Hunter-Digital 04-30-2009 08:51

Re: Kill assist
 
Quote:

Originally Posted by Dr.G (Post 817700)
didnt work for dod. all death messages were just blocked

well, this plugin blocks all death messages and sents them again... what's the deathmsg's params for dod, does it have headshot ? :? any errors in hlds console ?

-------------------

I think I got that bug fixed... I set amx_mode to 0 and then back to it's original value, shouldn't create any more problems... but didn't test it tough :?

joaquimandrade 04-30-2009 08:52

Re: Kill assist
 
lol nice idea.

+ http://tbn2.google.com/images?q=tbn:...autengLogo.gif

joaquimandrade 04-30-2009 09:11

Re: Kill assist
 
Now some tips. I just looked over the code. Probably i will look at the algorithm later.
__

Evaluate this:

PHP Code:

if(equal(g_szModName"cstrike") || equal(g_szModName"czero") || equal(g_szModName"csv15") || equal(g_szModName"cs13")) 

In plugin_init

Remove this:

PHP Code:

szName1[0] = '^0'
szName2[0] = '^0' 


YamiKaitou 04-30-2009 09:44

Re: Kill assist
 
Quote:

Originally Posted by Hunter-Digital (Post 817697)
Pffffff, big fricken bug :<... when a player's name will be changed that contains an admin's name he's kicked before he can change his name back... damn, I was SURE I'll have a big fricken error like his... anyone know how to block the check for admin or something ? :(

Don't give admin by name, that is one way

anakin_cstrike 04-30-2009 10:43

Re: Kill assist
 
Quote:

#define is_player(%1) (1 <= %1 && %1 <= g_iMaxPlayers)
->
Code:
#define is_player(%1) (1 <= %1 <= g_iMaxPlayers)

This is a very nice plugin, gj!

Hunter-Digital 04-30-2009 12:17

Re: Kill assist
 
Quote:

Originally Posted by YamiKaitou (Post 817730)
Don't give admin by name, that is one way

Heh, I just want compatibiltiy for servers that have that sort of thing :P

Quote:

Originally Posted by joaquimandrade (Post 817711)
Evaluate this:
PHP Code:

if(equal(g_szModName"cstrike") || equal(g_szModName"czero") || equal(g_szModName"csv15") || equal(g_szModName"cs13")) 

In plugin_init

Remove this:
PHP Code:

szName1[0] = '^0'
szName2[0] = '^0' 


How dumb of me to do 4 string checks every fricken time xD :lol: fixed, thanks :P

and that ... well, I thought I'd make sure the var is cleared :}

Quote:

Originally Posted by anakin_cstrike (Post 817752)
This is a very nice plugin, gj!

Modified and thanks :P

-------------------

New source uploaded, v1.0c =)

Also, I want to make this to work for other mods as well, but I don't know team names for dod, etc... can anyone help me on making this for dod and other mods 'cause I don't know how they react and I don't have the games...

Nextra 04-30-2009 13:41

Re: Kill assist
 
Was thinking about that when playing TF2, nice someone actually did it. However, here are some things you could/should change:

- Use get_cvar_pointer on amx_mode (check if it exists)
- Use formatex where applicable
- Why do you use g_bBlockDeathMsg? When you are not using emessages your plugin won't be able to block them anyway.

Hunter-Digital 04-30-2009 14:28

Re: Kill assist
 
Quote:

Originally Posted by Nextra (Post 817872)
However, here are some things you could/should change:
- Use get_cvar_pointer on amx_mode (check if it exists)
- Use formatex were applicable
- Why do you use g_bBlockDeathMsg? When you are not using emessages your plugin won't be able to block them anyway.

- hmm, never done that... I shall modify and test it out :P
- what's with formatex ? I didn't experiment much with formatting stuff, only format()
- ooooh... riight :mrgreen: fixing :oops:

thanks for input :}

new source uploaded

edit: oh, now I get the point with formatex, doesn't do a copyback, I don't use such thing in here so I could use that because it's faster... ok, done :P source uploaded... again

ConnorMcLeod 04-30-2009 15:30

Re: Kill assist
 
hamdatas.ini doesn't seems to support csv15 and cs13
Even setting @mirror cstrike csv15 i'm not sure it would work.

ajvn 04-30-2009 15:49

Re: Kill assist
 
Awesome! I made request for similiar plugin 2 months ago. Maybe you can add more features:

http://forums.alliedmods.net/showthread.php?t=89068

Dores 04-30-2009 16:37

Re: Kill assist
 
Really nice plugin, the code is extremely clean and just easy to read from. ;)

I have a few notes/questions though(probably stupid ones):

1) About iMinDamage = ch_pCVar_minDamage, why creating an extra var when you can just call it from first place iMinDamagePCVar or something?

2) About g_iDamage[p][iVictim] > iMinDamage, since it's the minimum damage, shouldn't it be: g_iDamage[p][iVictim] >= iMinDamage?

3) I think that this:
PHP Code:

for(1<= g_iMaxPlayersp++)
        {
            if(
!= iKiller && g_bOnline[p] && iKillerTeam == get_user_team(p) && g_iDamage[p][iVictim] > iMinDamage && g_iDamage[p][iVictim] > iDamage2)
            {
                
iKiller2 p
                iDamage2 
g_iDamage[p][iVictim]
                
g_iDamage[p][iVictim] = 0
            
}
        } 

should be like this:
PHP Code:

for(1<= g_iMaxPlayersp++)
        {
            if(
!= iKiller && g_bOnline[p] && iKillerTeam == get_user_team(p) && g_iDamage[p][iVictim] > iMinDamage && g_iDamage[p][iVictim] > iDamage2)
            {
                
iKiller2 p
                iDamage2 
g_iDamage[p][iVictim]
            }
            
            
g_iDamage[p][iVictim] = 0
        


since the victim already died...

4) I think you should create a global var to check the players' teams when they join a cretain team because not only that you use get_user_team everytime a player dies, you also use a loop and inside the loop you use that native so I just thought maybe it would be more efficient to create a global var instead...

5) Finally, I'd like to suggest you to add friendly fire compatibility. ;)


Sorry for nagging and nice plugin! :up:

Hunter-Digital 04-30-2009 17:07

Re: Kill assist
 
Thanks everyone for the tips, I'm off in a trip, I'll be back in 3-4 days :}

anakin_cstrike 04-30-2009 18:06

Re: Kill assist
 
Quote:

Originally Posted by Hunter-Digital (Post 818022)
Thanks everyone for the tips, I'm off in a trip, I'll be back in 3-4 days :}

1 Mai :D

Pamaliska 05-01-2009 02:21

Re: Kill assist
 
Have you even tested it? It completely messed my player names. Once it changes the names, they stay like that. It is a bad idea to change names in first place.

Dores 05-01-2009 06:15

Re: Kill assist
 
Quote:

Originally Posted by Pamaliska (Post 818288)
Have you even tested it? It completely messed my player names. Once it changes the names, they stay like that. It is a bad idea to change names in first place.

It's probably the only way to do it. I guess something happened that the plugin doesn't handle right. What exactly happened?

Alucard^ 05-01-2009 06:38

Re: Kill assist
 
Quote:

CVars and default values:

- amx_killassist_enable 1
Enable/disable (1/0) the plugin

- amx_killassist_mindamage 50
Minimum amount of damage to deal to be nominated for an assisted kill

- amx_killassist_givefrags 1
Give or not give the assister (2nd killer) frags
i think u have to put the cvars in the first post... some guys dont know nothing about .sma...

gj for the plugin ;)

tlch0324 05-01-2009 14:33

Re: Kill assist
 
nice plugin +karma

Hunter-Digital 05-04-2009 07:45

Re: Kill assist
 
Well, I'm back :P so... let's see...

Quote:

Originally Posted by ConnorMcLeod (Post 817946)
hamdatas.ini doesn't seems to support csv15 and cs13
Even setting @mirror cstrike csv15 i'm not sure it would work.

ehm... well, this is for CS 1.6 then, anyway I removed that mod check so doesn't matter :}

ajvn, I read your topic, added some features :P

dores, I like receiving tips from more experienced users, well...
1 - because it was initial set to get_pcvar_num() :lol: fixing
2 - yep, you're right, damn little things :P
3 - right again xD
4 - yes, I thought about that but here it comes the mod dilema =) I'll do it only for CS first and then focus on other mods then :)
5 - assisting on killing teammates ? WHY ? :lol:

Alucard^, already thinked of that before I left :}

Quote:

Originally Posted by anakin_cstrike (Post 818063)
1 Mai :D

Yep :P

Quote:

Originally Posted by Pamaliska (Post 818288)
Have you even tested it? It completely messed my player names. Once it changes the names, they stay like that. It is a bad idea to change names in first place.

Well, I tested it the first time, then some modifications and there was an error in the get_weaponid() and the task didn't launch and so on, the name didn't convert back... now I fixed that :}

New version uploaded, fixed and tested, should work perfectly on CS :) other mods... well, either help me do it or do it yourself :P I don't mind

Dores 05-04-2009 09:51

Re: Kill assist
 
Quote:

Originally Posted by Hunter-Digital (Post 820742)
dores, I like receiving tips from more experienced users, well...

I doubt that I'm considered a experienced coder.

Quote:

Originally Posted by Hunter-Digital (Post 820742)
5 - assisting on killing teammates ? WHY ? :lol:

Oh, right. Didn't think of it... :S

mplayerexe 05-04-2009 15:25

Re: Kill assist (for CS)
 
wow i`m loving it !
gj man

Hunter-Digital 05-05-2009 19:04

Re: Kill assist (for CS)
 
Anyone (else, because I have) tested the new version ? Works ok ? Any bugs ? Anything ?! :}

WhoME? 05-07-2009 23:41

Re: Kill assist (for CS)
 
The commands u put won't work for me.

Hunter-Digital 05-08-2009 01:10

Re: Kill assist (for CS)
 
wich commands don't work.. ?

Tirant 05-09-2009 14:37

Re: Kill assist (for CS)
 
I like the plugin, but I don't like the name change because it will mess with people. Add in like a hud message for the person getting the assist with like +Assist or something.

DotPT 05-09-2009 15:38

Re: Kill assist (for CS)
 
Won't it spam/lag because of the name changes?
Nice idea :)

Hunter-Digital 05-09-2009 16:08

Re: Kill assist (for CS)
 
Nope, because this is not verry likely to happen on EVERY kill... if it does, increase the min damage :P it would be awesome to just set it to 99 for those verry rare lost frags xD

I *could* make a bot and name it to the two player's name... but joining fake bots have alot of consequences on severs with different mods and stuff... one simple fact is the join hud and country plugins, and I don't know how to silent-join a bot :lol:

Xellath 05-09-2009 18:03

Re: Kill assist (for CS)
 
Good Job, Hunter! :crab:

mplayerexe 05-16-2009 04:32

Re: Kill assist (for CS)
 
maybe u can add a message

Hunter-Digital 05-16-2009 16:38

Re: Kill assist (for CS)
 
huh ?

Dores 05-16-2009 18:57

Re: Kill assist (for CS)
 
what do you need a message for? you can see the frags...

freamer 05-19-2009 17:46

Re: Kill assist (for CS)
 
It would be nice to have a cvar to disable name changing and instead just write some message or something in the hud.

Awesome plugin, thank you...


All times are GMT -4. The time now is 05:49.

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