AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to get stamina value of DOD (https://forums.alliedmods.net/showthread.php?t=40548)

fishman8 06-29-2006 04:05

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

like dod_get_stamina function .. thanks. :D

jtp10181 06-29-2006 06:40

Re: How to get stamina value of DOD
 
there is probably a server message sent.... maybe I can find it later today when I'm done with work.

teame06 06-29-2006 13:26

Re: How to get stamina value of DOD
 
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)
}


fishman8 07-01-2006 14:08

Re: How to get stamina value of DOD
 
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 07-01-2006 23:37

Re: How to get stamina value of DOD
 
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..... :-(

teame06 07-02-2006 00:29

Re: How to get stamina value of DOD
 
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.

fishman8 07-18-2006 12:18

Re: How to get stamina value of DOD
 
It worked. Thank you very much!

Maybe it should add in the official function :P


All times are GMT -4. The time now is 07:56.

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