Raised This Month: $ Target: $400
 0% 

Get ID of player which i spectate


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
vamvam
Junior Member
Join Date: Jan 2016
Old 01-08-2017 , 14:09   Get ID of player which i spectate
Reply With Quote #1

Hello,

I've got a HUD(info level, name etc.) for BF mod player. And i wanna show when i spectate my friend i see his level, name etc.. Then i need to get his ID and call it from the DB, can anyone say me how can i get ID of player which i spectate? Thx

Sorry, my eng isn't good.
vamvam is offline
Nekoz
Member
Join Date: Oct 2016
Old 01-08-2017 , 15:48   Re: Get ID of player which i spectate
Reply With Quote #2

PHP Code:
static GetObserverTarget(client)
{
    return 
GetEntPropEnt(clientProp_Send"m_hObserverTarget");

Probably this work
Nekoz is offline
_GamerX
AlliedModders Donor
Join Date: Jun 2011
Location: Fun Server
Old 01-08-2017 , 15:49   Re: Get ID of player which i spectate
Reply With Quote #3

PHP Code:
int target GetEntPropEnt(iProp_Send"m_hObserverTarget"); 
__________________
_GamerX is offline
Send a message via ICQ to _GamerX Send a message via Skype™ to _GamerX
vamvam
Junior Member
Join Date: Jan 2016
Old 01-08-2017 , 15:58   Re: Get ID of player which i spectate
Reply With Quote #4

Thanks.

Last edited by vamvam; 01-08-2017 at 16:42.
vamvam is offline
Michael Shoe Maker
Senior Member
Join Date: Apr 2016
Old 01-08-2017 , 16:43   Re: Get ID of player which i spectate
Reply With Quote #5

Quote:
Originally Posted by vamvam View Post
new target = GetEntPropEnt(client, Prop_Send, "m_hObserverTarget");
new target = GetObserverTarget(client)

These are same?
They do exactly the same thing, one is just function which returns the value of that netprop.
Michael Shoe Maker is offline
vamvam
Junior Member
Join Date: Jan 2016
Old 01-08-2017 , 16:49   Re: Get ID of player which i spectate
Reply With Quote #6

Quote:
Originally Posted by Michael Shoe Maker View Post
They do exactly the same thing, one is just function which returns the value of that netprop.
Yeah, i tried it. But thanks a lot!
vamvam 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 17:40.


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