Raised This Month: $51 Target: $400
 12% 

How to check if a player killed himself?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SyluxLockjaw100
Senior Member
Join Date: Jul 2010
Location: Novaya Russia
Old 07-11-2012 , 05:37   How to check if a player killed himself?
Reply With Quote #1

Or check if a player is killed by the "worldspawn" entity?
SyluxLockjaw100 is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 07-11-2012 , 05:49   Re: How to check if a player killed himself?
Reply With Quote #2

Killer ID will be either 0 or equal to victim ID.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 07-11-2012 , 11:28   Re: How to check if a player killed himself?
Reply With Quote #3

check my admin explode plugin, there will detect if player was killed by worldspawn and other entities
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
Santaaa
BANNED
Join Date: May 2012
Old 07-11-2012 , 11:47   Re: How to check if a player killed himself?
Reply With Quote #4

PHP Code:
new killer read_data(1)
new 
victim read_data(2)

if (
killer == victim)
{
// action

This is an example used for the DeathMsg event.

Last edited by Santaaa; 07-11-2012 at 11:47.
Santaaa is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 07-11-2012 , 13:19   Re: How to check if a player killed himself?
Reply With Quote #5

Taken from my killstreak plugin, it should work tho
PHP Code:
#include <amxmodx>

#define PLUGIN "Hook WorldSpawn Kills"
#define VERSION "0.0.1"
#define AUTHOR "wbyokomo"

new g_msgHudSync

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("DeathMsg""OnWsKilled""a""4&wor")
    
    
g_msgHudSync CreateHudSyncObj()
}

public 
OnWsKilled()
{
    new 
vname[32]
    
get_user_name(read_data(2), vnamecharsmax(vname))
    
set_hudmessage(0100255, -1.00.2706.05.0)
    
ShowSyncHudMsg(0g_msgHudSync"Oh God %s killed by world spawn."vname)

Please not it will hook the death by custom entity too for example lasermine. I don't know why it become like that maybe it detect all "skull" icon in death message, erkkk whatever.
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
SyluxLockjaw100
Senior Member
Join Date: Jul 2010
Location: Novaya Russia
Old 07-12-2012 , 02:36   Re: How to check if a player killed himself?
Reply With Quote #6

Thanks alot guys
SyluxLockjaw100 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 20:18.


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