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)

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:


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

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