Raised This Month: $ Target: $400
 0% 

getting users health doesn't work


Post New Thread Reply   
 
Thread Tools Display Modes
Olly
Senior Member
Join Date: Mar 2007
Location: UK
Old 05-27-2007 , 21:45   Re: getting users health doesn't work
Reply With Quote #21

NEVER, EVER! use a listen server to test plugins and stuff like that. You will spend hours getting it to work, only to find that it works differently when its on a dedicated server.

And btw RegConsoleCmd only works for client, but i dont know how that would work with a listen server....
you see the problem? confusion already
__________________
Tumblr Me: http://raspberryteen.tumblr.com


// Yarrrr!
Olly is offline
Send a message via MSN to Olly
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 05-28-2007 , 02:14   Re: getting users health doesn't work
Reply With Quote #22

I nearly always use a listenserver for testing. No problems so far.
L. Duke is offline
FlyingMongoose
Veteran Member
Join Date: Mar 2004
Old 05-28-2007 , 14:14   Re: getting users health doesn't work
Reply With Quote #23

That's because you're weird LDuke.

I have had nothing but problems, inconsistencies, and erroneous installations if I use anything BUT the HLDSUpdateTool install. Meaning, I don't use steam "Source Server", and I don't use a listen server. I ALWAYS use the standalone...always.
__________________
Please do NOT PM for support.

Only ask for support in plugin threads.

TunedChaos.com - Precision Tuned Game Servers
FlyingMongoose is offline
dutchmeat
Senior Member
Join Date: Sep 2006
Old 05-31-2007 , 07:47   Re: getting users health doesn't work
Reply With Quote #24

so what can I do ?
__________________
before you criticize someone, you should walk a mile in their shoes. that way, when you criticize them, you're a mile away and you have their shoes.
dutchmeat is offline
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 05-31-2007 , 10:12   Re: getting users health doesn't work
Reply With Quote #25

What mod is this for?

Also, it's not clear to me from the code whether "playerindex" is a userid or an entity index. Which does FindDataMapOffset require and which is being sent in?
L. Duke is offline
FlyingMongoose
Veteran Member
Join Date: Mar 2004
Old 05-31-2007 , 10:48   Re: getting users health doesn't work
Reply With Quote #26

It requires entity index.

Are you assuming he's trying to find it via userid?
__________________
Please do NOT PM for support.

Only ask for support in plugin threads.

TunedChaos.com - Precision Tuned Game Servers
FlyingMongoose is offline
dutchmeat
Senior Member
Join Date: Sep 2006
Old 05-31-2007 , 12:16   Re: getting users health doesn't work
Reply With Quote #27

Hmm, that's a possibility, but I don't know if the 'client' var(referring to page one of this topic)is a userid, or an entity.
__________________
before you criticize someone, you should walk a mile in their shoes. that way, when you criticize them, you're a mile away and you have their shoes.
dutchmeat is offline
Olly
Senior Member
Join Date: Mar 2007
Location: UK
Old 05-31-2007 , 12:36   Re: getting users health doesn't work
Reply With Quote #28

Well does an event call this function '
GetPlayerHealth' ?
__________________
Tumblr Me: http://raspberryteen.tumblr.com


// Yarrrr!
Olly is offline
Send a message via MSN to Olly
FlyingMongoose
Veteran Member
Join Date: Mar 2004
Old 05-31-2007 , 13:45   Re: getting users health doesn't work
Reply With Quote #29

based on your test it should actually work dutch, the RegConsoleCmd first param is based on index, not userid. and player index is usually their entid
__________________
Please do NOT PM for support.

Only ask for support in plugin threads.

TunedChaos.com - Precision Tuned Game Servers
FlyingMongoose is offline
Rakshu
New Member
Join Date: Sep 2009
Old 09-20-2009 , 19:53   Re: getting users health doesn't work
Reply With Quote #30

Try this:

public OnPluginStart()
{
...........
g_HealthOffset = FindSendPropOffs("CPlayerResource", "m_iHealth");
...........
}

public Action:Test(client,args){
PrintToServer("%d",GetEntData(client, g_HealthOffset + (client * 4)));
return Plugin_Handled;
}

CPlayerResource is an array of values for each player, not only for one ...
Rakshu 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 04:28.


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