AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Detecting who is the first one who died (https://forums.alliedmods.net/showthread.php?t=53646)

Dark Killer 04-08-2007 06:04

Detecting who is the first one who died
 
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

Ryu2877 04-08-2007 07:08

Re: Detecting who is the first one who died
 
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)



Dark Killer 04-08-2007 08:09

Re: Detecting who is the first one who died
 
Thanks very much! Much appreciated! :D


All times are GMT -4. The time now is 06:43.

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