Raised This Month: $ Target: $400
 0% 

[HELP] Getting details about who killed and dead. using Hamsandwich lib.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
unSeen
Member
Join Date: Sep 2008
Old 02-18-2009 , 06:16   [HELP] Getting details about who killed and dead. using Hamsandwich lib.
Reply With Quote #1

Hey everybody,
Before i start with my question, i wanna say SORRY about my English..
It's now me it's the English teachers in my country ;-)

So, i heard about Hamsandwich, and i want to make a plugin that doing something after some one killed.
I so in one of the plugins here, that someone used HamSandwich there,
Something like this:

PHP Code:
public plugin_init()
    
RegisterHam(Ham_Killed"player""death_func"1)
 
public 
death_func(idszKillershouldgib)
{
    new 
a,b,c
    id 
a
    szKiller 
b
    shouldgib 
c
    
....
 
 
    ....

Now I have 2 questions:
1. What the third parameter in the death_func function says? (I have problem on my server so i couldn't check it alone)
2. How can i get the id of the Killer?

And one more thing,
If i want to write each time in the server memory when some one killed somebody, how would i save it if i want to save more then one parameter?
I mean, i want to make something like a table:
PHP Code:
authid   killed   died   
STEAM_X
:X:X 5 2 
And last thing,
How can i check if the death is an headshot?


Thanks,
Elad.
__________________
List of important things:
1. Respect you'r mother.
2. Respect you'r father.
3. Do not hit anyone.
4. Do not steal.
5. Do not flame.
7. You didn't see that there is no number 6.
8. You checked if number 7 is true.
9. You are laughing now.
10. You are double laughing because you understand the joke ;)

Last edited by unSeen; 02-18-2009 at 06:41.
unSeen is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-18-2009 , 06:29   Re: [HELP] Getting details about who killed and dead. using Hamsandwich lib.
Reply With Quote #2

1. it tells you if player should explode into gibs or not.
2. In you example ; szKiller. Which should be Killer.
Arkshine is offline
unSeen
Member
Join Date: Sep 2008
Old 02-18-2009 , 06:38   Re: [HELP] Getting details about who killed and dead. using Hamsandwich lib.
Reply With Quote #3

You mean the ID of the killer?
(btw thanks alot)

and some one know about 3rd and 4th question?
__________________
List of important things:
1. Respect you'r mother.
2. Respect you'r father.
3. Do not hit anyone.
4. Do not steal.
5. Do not flame.
7. You didn't see that there is no number 6.
8. You checked if number 7 is true.
9. You are laughing now.
10. You are double laughing because you understand the joke ;)

Last edited by unSeen; 02-18-2009 at 06:41.
unSeen is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-18-2009 , 06:46   Re: [HELP] Getting details about who killed and dead. using Hamsandwich lib.
Reply With Quote #4

Yep.

4. About the headshot, 2 easy ways are :

- if using Ham, you can check the offset 75 (m_LastHitGroup) ; something like : if ( get_pdata_int( id, 75 ) == HIT_HEAD )
- Using the DeathMsg event instead of ham, and cheking the third param.
Arkshine is offline
unSeen
Member
Join Date: Sep 2008
Old 02-18-2009 , 06:53   Re: [HELP] Getting details about who killed and dead. using Hamsandwich lib.
Reply With Quote #5

thanks.

sorry that I anoyne,
My last question, How can i know wich weapon the killer used?
__________________
List of important things:
1. Respect you'r mother.
2. Respect you'r father.
3. Do not hit anyone.
4. Do not steal.
5. Do not flame.
7. You didn't see that there is no number 6.
8. You checked if number 7 is true.
9. You are laughing now.
10. You are double laughing because you understand the joke ;)
unSeen is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-18-2009 , 07:00   Re: [HELP] Getting details about who killed and dead. using Hamsandwich lib.
Reply With Quote #6

You can use get_user_attacker().

Code:
new WeaponId, HitZone;
get_user_attacker( id, WeaponId, HitZone );
WeaponId will give you the killer's weapon id ( CSW_* ; see amxconst.inc )
HitZone will give you the last zone which has killed the player, like m_LastHitGroup. ( HIT_* ; see amxconst.inc )

If you use the DeathMsg Event, the killer's weapon name is passed into the fourth param. If you need the weapon id, you can use get_weaonid().
Arkshine is offline
unSeen
Member
Join Date: Sep 2008
Old 02-18-2009 , 07:07   Re: [HELP] Getting details about who killed and dead. using Hamsandwich lib.
Reply With Quote #7

ok thank you alot!
I appraise you'r help!
__________________
List of important things:
1. Respect you'r mother.
2. Respect you'r father.
3. Do not hit anyone.
4. Do not steal.
5. Do not flame.
7. You didn't see that there is no number 6.
8. You checked if number 7 is true.
9. You are laughing now.
10. You are double laughing because you understand the joke ;)
unSeen is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-18-2009 , 07:16   Re: [HELP] Getting details about who killed and dead. using Hamsandwich lib.
Reply With Quote #8

Actually, you can use get_user_weapon( Killer ) if you need only to know the weaponid used.
Arkshine is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-18-2009 , 14:17   Re: [HELP] Getting details about who killed and dead. using Hamsandwich lib.
Reply With Quote #9

The killer id is an integer so you shouldn't use "sz" as this indicates a zero-terminated string; for clarity.
fysiks 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 20:21.


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