AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Check if a player died? (https://forums.alliedmods.net/showthread.php?t=74247)

johhnn12120 07-14-2008 19:16

Check if a player died?
 
Sup, my name is John. Will this work?

if (attacker == 0)
{
//Player died?
}

Vet 07-14-2008 23:21

Re: Check if a player died?
 
It depends on what function you're getting 'attacker' from.
Also, the ID of 0 will NOT be a player (0 = world).

johhnn12120 07-15-2008 05:25

Re: Check if a player died?
 
I found it in a XP Based Plugin - Tutorial.

new attacker = read_data(1)

And i thought

if (attacker == 0)
{
//You killed a player
}

Would work..

v3x 07-15-2008 06:35

Re: Check if a player died?
 
PHP Code:

#include <amxmodx>

public plugin_init()
{
  
register_event("DeathMsg""EventDeathMsg""a""1!0""2!0");
}

public 
EventDeathMsg()
{
  new 
attacker read_data(1);
  new 
victim read_data(2);

  if(!
is_user_alive(attacker))
    return 
PLUGIN_CONTINUE;

  
// your code

  
return PLUGIN_CONTINUE;



johhnn12120 07-15-2008 07:36

Re: Check if a player died?
 
Could you describe how this work?


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

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