Raised This Month: $ Target: $400
 0% 

Detecting who is the first one who died


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dark Killer
Senior Member
Join Date: May 2005
Location: Kowloon, Hong Kong
Old 04-08-2007 , 06:04   Detecting who is the first one who died
Reply With Quote #1

Hi,

Please help me! I want my plugin to detect who is the first one died and do something. Please help me. Thanks!

Dark Killer
__________________

Last edited by Dark Killer; 04-08-2007 at 06:08.
Dark Killer is offline
Ryu2877
Member
Join Date: Sep 2006
Location: China
Old 04-08-2007 , 07:08   Re: Detecting who is the first one who died
Reply With Quote #2

use "DeathMsg" event.

underside will check out the first victim every round:
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#define PLUGIN_NAME "New Plug-In"
#define PLUGIN_VERSION "0.1"
#define PLUGIN_AUTHOR "CZ*Ryu"
new iFirstVictim
public plugin_init()
{
 
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR);
 
 
register_event("HLTV""e_HLTV_NewRound""a""1=0""2=0")
 
register_event("DeathMsg""e_DeathMsg_CheckFirstVictim","a""1!0""4!c4")
}
public 
e_HLTV_NewRound()
{
 
iFirstVictim 0
}
public 
e_DeathMsg_CheckFirstVictim()
{
 if ( 
iFirstVictim )
  return
 new 
iKiller read_data(1)//killer id
 
new iVictim read_data(2)//victim id
 
if ( iKiller == iVictim )//filtrate suicide
  
return
 
//do something you want here
 
iFirstVictim iVictim
 
new sVictim[32]
 
get_user_name(iVictimsVictimsizeof sVictim 1)
 
client_print(0print_chat"The first victim is %s"sVictim)

Ryu2877 is offline
Dark Killer
Senior Member
Join Date: May 2005
Location: Kowloon, Hong Kong
Old 04-08-2007 , 08:09   Re: Detecting who is the first one who died
Reply With Quote #3

Thanks very much! Much appreciated!
__________________
Dark Killer 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 06:43.


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