AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   how to check if player died after being damaged by another player (https://forums.alliedmods.net/showthread.php?t=93790)

zacky 06-02-2009 14:11

how to check if player died after being damaged by another player
 
How to check if a player died after being damaged by another player?

And how to check if the attacker killed him with headshot?

Thanks
-zacky

Arkshine 06-02-2009 14:14

Re: how to check if player died after being damaged by another player
 
Check if attacker is a player. ( whatever using client_death() forward, Ham_Killed, or DeathMsg event )

zacky 06-02-2009 14:15

Re: how to check if player died after being damaged by another player
 
But i don't know how to use those stuff, so may you show a code of it and how to check if attacked made a headshot on him?

EDIT: I almost never use client_death and those deathmsgs stuff.

Arkshine 06-02-2009 14:29

Re: how to check if player died after being damaged by another player
 
Using deathmsg event :

Something like :

Code:
new gMaxClients; // [...] register_event( "DeathMsg", "Event_PlayerDeath", "a", "1>0", "3=1" ); // param 3 = headshot gMaxClients = get_maxplayers(); // [...] public Event_PlayerDeath () {     new Killer = read_data( 1 );         if ( 1 <= Killer <= gMaxClients )     {         //     } }

zacky 06-02-2009 14:39

Re: how to check if player died after being damaged by another player
 
Ok, is Killer attacker or victim?

LaineN 06-02-2009 14:42

Re: how to check if player died after being damaged by another player
 
Attacker

zacky 06-03-2009 13:10

Re: how to check if player died after being damaged by another player
 
Ok thanks


All times are GMT -4. The time now is 13:52.

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