Raised This Month: $ Target: $400
 0% 

Check if a player died?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
johhnn12120
New Member
Join Date: Jul 2008
Old 07-14-2008 , 19:16   Check if a player died?
Reply With Quote #1

Sup, my name is John. Will this work?

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

I'm new to the language, Pawn! Really fun and cool!
johhnn12120 is offline
Vet
Veteran Member
Join Date: Jul 2006
Location: I|O wa
Old 07-14-2008 , 23:21   Re: Check if a player died?
Reply With Quote #2

It depends on what function you're getting 'attacker' from.
Also, the ID of 0 will NOT be a player (0 = world).
__________________
=====================================
- My Plugins -
=====================================
Vet is offline
Send a message via MSN to Vet
johhnn12120
New Member
Join Date: Jul 2008
Old 07-15-2008 , 05:25   Re: Check if a player died?
Reply With Quote #3

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..
__________________
Sup.

I'm new to the language, Pawn! Really fun and cool!
johhnn12120 is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 07-15-2008 , 06:35   Re: Check if a player died?
Reply With Quote #4

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;

__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
johhnn12120
New Member
Join Date: Jul 2008
Old 07-15-2008 , 07:36   Re: Check if a player died?
Reply With Quote #5

Could you describe how this work?
__________________
Sup.

I'm new to the language, Pawn! Really fun and cool!
johhnn12120 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 05:29.


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