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

Solved Get dead players in radius


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
karaulov
Senior Member
Join Date: Jul 2018
Old 11-08-2019 , 05:05   Get dead players in radius
Reply With Quote #1

Help m! How to get dead players in radius?! (NOT SPECTATORS!)

I tried use get_user_origin,get_players_distance, entity_get_vector( id, EV_VEC_origin

But instead origin of dead players(position of dead player body) , i got origin of spectator players(position at what dead player look at this moment)...

Last edited by karaulov; 11-08-2019 at 14:26.
karaulov is offline
iNvectus
Member
Join Date: Sep 2014
Location: Bulgaria
Old 11-08-2019 , 10:27   Re: Get dead players in radius
Reply With Quote #2

You can try hooking when the player dies and save the origin to variable. Once you have this, you can do whatever you want with it.
iNvectus is offline
karaulov
Senior Member
Join Date: Jul 2018
Old 11-08-2019 , 10:50   Re: Get dead players in radius
Reply With Quote #3

Quote:
Originally Posted by iNvectus View Post
You can try hooking when the player dies and save the origin to variable. Once you have this, you can do whatever you want with it.
Strange, very strange! AMXX is not present function to get real player death position ?

Impossible to get player dead body position ?

Last edited by karaulov; 11-08-2019 at 10:51.
karaulov is offline
iNvectus
Member
Join Date: Sep 2014
Location: Bulgaria
Old 11-08-2019 , 11:08   Re: Get dead players in radius
Reply With Quote #4

And how do you find strange to get the dead player's dead body origin when he is dying? That is the regular thing to be done like this..

Code:
#include <amxmodx> new Float:g_iDeadPlayerOrigin[33][3]; public plugin_init() {     register_plugin("Test", "1.0", "invectus"); } public client_death(iKiller, iVictim, iWpnIndex, iHitPlace, iTeammateKill) {     if(!is_user_connected(iVictim))         return;     get_user_origin(iVictim, g_iDeadPlayerOrigin[iVictim], .mode = 0);     client_print(0, print_chat, "%f -- %f -- %f", g_iDeadPlayerOrigin[iVictim][0], g_iDeadPlayerOrigin[iVictim][1], g_iDeadPlayerOrigin[iVictim][2]);     return PLUGIN_HANDLED; }
iNvectus is offline
karaulov
Senior Member
Join Date: Jul 2018
Old 11-08-2019 , 12:38   Re: Get dead players in radius
Reply With Quote #5

Quote:
Originally Posted by iNvectus View Post
And how do you find strange to get the dead player's dead body origin when he is dying? That is the regular thing to be done like this..

Code:
#include <amxmodx> new Float:g_iDeadPlayerOrigin[33][3]; public plugin_init() {     register_plugin("Test", "1.0", "invectus"); } public client_death(iKiller, iVictim, iWpnIndex, iHitPlace, iTeammateKill) {     if(!is_user_connected(iVictim))         return;     get_user_origin(iVictim, g_iDeadPlayerOrigin[iVictim], .mode = 0);     client_print(0, print_chat, "%f -- %f -- %f", g_iDeadPlayerOrigin[iVictim][0], g_iDeadPlayerOrigin[iVictim][1], g_iDeadPlayerOrigin[iVictim][2]);     return PLUGIN_HANDLED; }
But if player killed in fly ? How to get position dead body instead of "position of kill" ?

Last edited by karaulov; 11-08-2019 at 12:39.
karaulov is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 11-08-2019 , 14:15   Re: Get dead players in radius
Reply With Quote #6

Quote:
Originally Posted by karaulov View Post
But if player killed in fly ? How to get position dead body instead of "position of kill" ?
There is no "dead body" on the server side of things so it is natural there is not a straightforward way of doing that.

I didn't play cs in ages so I do not remember, but if a player is killed while airborne then his body will fail straight down, right? Then you just get the kill position and do a traceline downwards(from current position to a new position which has the same x, y as the kill pos and z is -9999.9).
Get the TR_vecEndPos from the traceline and you got the position where the body "landed"(assuming it goes straight down). You may want to add a small offset to the z component depending on what you will use this position for.
__________________

Last edited by HamletEagle; 11-08-2019 at 14:16.
HamletEagle is offline
iNvectus
Member
Join Date: Sep 2014
Location: Bulgaria
Old 11-08-2019 , 14:17   Re: Get dead players in radius
Reply With Quote #7

You will have to get it grounded. Consider using this https://forums.alliedmods.net/showpo...&postcount=103

Or you can try to pev_origin X and Y, then pev_absmin on Z
iNvectus is offline
karaulov
Senior Member
Join Date: Jul 2018
Old 11-08-2019 , 14:26   Re: Get dead players in radius
Reply With Quote #8

Need just wait two second after dead message, and then get real origin of dead body!
karaulov is offline
Reply


Thread Tools
Display Modes

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:06.


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