Raised This Month: $ Target: $400
 0% 

How to get stamina value of DOD


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fishman8
Junior Member
Join Date: Jul 2005
Old 06-29-2006 , 04:05   How to get stamina value of DOD
Reply With Quote #1

Please can you tell me how to get stamina of DoD ?

like dod_get_stamina function .. thanks.
fishman8 is offline
jtp10181
Veteran Member
Join Date: May 2004
Location: Madison, WI
Old 06-29-2006 , 06:40   Re: How to get stamina value of DOD
Reply With Quote #2

there is probably a server message sent.... maybe I can find it later today when I'm done with work.
__________________
jtp10181 is offline
Send a message via ICQ to jtp10181 Send a message via AIM to jtp10181 Send a message via MSN to jtp10181 Send a message via Yahoo to jtp10181
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 06-29-2006 , 13:26   Re: How to get stamina value of DOD
Reply With Quote #3

This code below should work to get the current stamina of the person. I havn't tested it.

Code:
stock dod_get_stamina(id)
{
	new Float:Stamina
	pev(id, pev_fuser4, Stamina)
	
	return floatround(Stamina)
}
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
fishman8
Junior Member
Join Date: Jul 2005
Old 07-01-2006 , 14:08   Re: How to get stamina value of DOD
Reply With Quote #4

Quote:
Originally Posted by teame06
This code below should work to get the current stamina of the person. I havn't tested it.

Code:
stock dod_get_stamina(id)
{
	new Float:Stamina
	pev(id, pev_fuser4, Stamina)
	
	return floatround(Stamina)
}
Thank you! I will try. ^_^
fishman8 is offline
fishman8
Junior Member
Join Date: Jul 2005
Old 07-01-2006 , 23:37   Re: How to get stamina value of DOD
Reply With Quote #5

stock dod_get_stamina(id)
{
new Float:Stamina
pev(id, pev_fuser4, Stamina)

return floatround(Stamina)
}

public plugin_init()
{
set_task(1.0, "stamina_value",_,_,_,"b")
}
public stamina_value(id)
{
new i = dod_get_stamina(id)
client_print(id,print_center,"stamina:%d",i)
}


It always show "stamina:0", maybe it doesn't work..... :-(
fishman8 is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 07-02-2006 , 00:29   Re: How to get stamina value of DOD
Reply With Quote #6

Code:
#include <amxmodx>
#include <fakemeta>

stock dod_get_stamina(id)
{
	new Float:Stamina
	pev(id, pev_fuser4, Stamina)

	return floatround(Stamina)
}

public plugin_init()
{
	set_task(1.0, "stamina_value",_,_,_,"b")
}
public stamina_value()
{
	new players[32], nums
	get_players(players, nums, "a")

	new id
	for(new i = 0; i < nums; i++)
	{
		id = players[i]
		client_print(id, print_center, "stamina: %d", dod_get_stamina(id))
	}
}
Your not passing a id with the set task. So it will be passing 0 which dod_get_stamina is getting.
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
fishman8
Junior Member
Join Date: Jul 2005
Old 07-18-2006 , 12:18   Re: How to get stamina value of DOD
Reply With Quote #7

It worked. Thank you very much!

Maybe it should add in the official function
fishman8 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 07:56.


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