Day of Defeat Plugins Community
This site is an archive — everything is readable and downloadable, nothing can be posted. Admin

read out owner of grenade-entity

by ghzero · 2009-03-29 · 7 replies · 978 views · 4 downloads

Read the thread (8 posts)

From the first post

hello,
rnhow to read out the owner(player) of an grenade-entity..
rnI have tried these with...
rn
rn

    rn
  • new entowner = entity_get_edict(grenent, EV_ENT_owner);
    rn
  • new entowner = pev(grenent, pev_owner);
    rn

rn
rnbut both results are zero! :-(

Added later in the thread

dod_checkattacker.sma v0.10gh 5 KB 4 dl Download Compile

The thread

All 8 posts from 2 people on read out owner of grenade-entity, kept as they were written.

ghzero
started this thread
Posts: 160
Threads: 42
Joined: Sep 2007
03-29-2009, 03:20 PM #1

hello,rnhow to read out the owner(player) of an grenade-entity..rnI have tried these with...rnrn

  • rn
  • new entowner = entity_get_edict(grenent, EV_ENT_owner);rn
  • new entowner = pev(grenent, pev_owner);rn
rnrnbut both results are zero! :-(

Dr.G
posted here
Posts: 776
Threads: 75
Joined: Nov 2007
03-29-2009, 03:36 PM #2

show some more code

ghzero
started this thread
Posts: 160
Threads: 42
Joined: Sep 2007
03-29-2009, 03:47 PM #3

I made an script to detect if the engine made an error..rnrnnote: that plugin works not proper jet coz of the right code for readout of grenent is missing so the check is not finished to found an engine bug.

Dr.G
posted here
Posts: 776
Threads: 75
Joined: Nov 2007
03-29-2009, 04:29 PM #4

my eyes is still bleeding that code is so awfull, sry but it really is. what do you want to happen? i cant read that code..

Dr.G
posted here
Posts: 776
Threads: 75
Joined: Nov 2007
03-29-2009, 05:21 PM #5

if you wanna know who killed who with a nade you can do it as simple as this:rnrn

#include <amxmodx>rn#include <dodx>rnrn#define PLUGIN "Client Death"rn#define VERSION "1.0"rn#define AUTHOR "dodplugins.net"rnrnrnpublic plugin_init() rn{rn	register_plugin(PLUGIN, VERSION, AUTHOR)rn	rn	// Add your code here...rn}rnrnpublic client_death(killer, victim, wpnindex, hitplace, TK) // DONT come up with new names here! others cant read your code thenrn{rn	if(wpnindex == DODW_HANDGRENADE || wpnindex == DODW_HANDGRENADE_EX || wpnindex ==  DODW_STICKGRENADE || wpnindex == DODW_STICKGRENADE_EX)rn	{rn		new victim_name[32]rn		new killer_name[32]rn		rn		get_user_name( victim, victim_name, sizeof victim_name - 1 )rn		get_user_name( killer, killer_name, sizeof killer_name - 1 )rn		rn		if(TK)rn		{rn			client_print( 0, 3, "[%s - %s] DAMN! %s TK'ed %s with a nade. Visit %s", PLUGIN, VERSION, killer_name, victim_name, AUTHOR)rn			rn			return PLUGIN_CONTINUErn		}rn		rn		rn		if(victim == killer)rn		{rn			client_print( 0, 3, "[%s - %s] LOL %s eat his own grenade. Visit %s", PLUGIN, VERSION, killer_name, AUTHOR)rn			rn			return PLUGIN_CONTINUErn		}rn		rn		client_print( 0, 3, "[%s - %s] %s killed %s with a nade. Visit %s", PLUGIN, VERSION, killer_name, victim_name, AUTHOR)rn	}rn	return PLUGIN_CONTINUErn}rn
rnrnyou need to understand what and when the forward is called..

ghzero
started this thread
Posts: 160
Threads: 42
Joined: Sep 2007
03-29-2009, 05:35 PM #6

reason is I do not thrust engine / amxmodx / module that the client_death gives the right data of killer (by some feedback of players)... so I tried to check this with that script - but it is not complete at this time ...it needs the read out of the owner of grenadeentity to confirm/check this in the client_death()rnrnif u can tell me how to readout the owner of an grenadeentity it wil help to complete my script to check this..

Dr.G
posted here
Posts: 776
Threads: 75
Joined: Nov 2007
03-29-2009, 05:47 PM #7

i dont get it, well the client_death is a part of dodx... then try hamsandwich. if you want the owner of an entity do like this:rnrn

new id = pev(iEnt, pev_owner)
rnrnbut remember the nade entity might be death/gone when someone is killed, so try catching it in a take_damage event.

ghzero
started this thread
Posts: 160
Threads: 42
Joined: Sep 2007
03-29-2009, 05:53 PM #8

allright that code if have allready tried in client_death() ,rnso I try this now in client_damage() now by your information..

DoD Plugins Archive · Repository · Old Forum Threads · Maps · Admin · built 14 Sep 2026 00:34 UTC