rnhow to read out the owner(player) of an grenade-entity..
rnI have tried these with...
rn
rn
- new entowner = entity_get_edict(grenent, EV_ENT_owner);
rn - new entowner = pev(grenent, pev_owner);
rn
rn
rn
rnbut both results are zero! :-(
by ghzero · 2009-03-29 · 7 replies · 978 views · 4 downloads
All 8 posts from 2 people on read out owner of grenade-entity, kept as they were written.
hello,rnhow to read out the owner(player) of an grenade-entity..rnI have tried these with...rnrn
show some more code
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.
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..
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}rnrnrnyou need to understand what and when the forward is called..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..
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.allright that code if have allready tried in client_death() ,rnso I try this now in client_damage() now by your information..