[Include] stamina (control each player stamina)
#7

PHP код:
#include <a_samp>
#include <stamina>
#include <progress2>
#include <zcmd>

new sbtime[MAX_PLAYERS];
new 
PlayerBar:StaminaBar[MAX_PLAYERS];

public 
OnPlayerConnect(playerid)
{
    if(
IsPlayerNPC(playerid)) return 1;
    
StaminaBar[playerid] = CreatePlayerProgressBar(playerid547.030.063.05.00xFFFFFFFF100.0BAR_DIRECTION_RIGHT0x000000FF);
    
ShowPlayerProgressBar(playeridStaminaBar[playerid]);
    return 
1;
}

public 
OnPlayerDisconnect(playeridreason)
{
    if(
IsPlayerNPC(playerid)) return 1;
    
DestroyPlayerProgressBar(playeridStaminaBar[playerid]);
    return 
1;
}

public 
OnPlayerOutOfStamina(playerid)
{
    
ApplyAnimation(playerid"PED""IDLE_tired"4.10110STAMINA_UPDATE_TIME*51);
    return 
1;
}

CMD:sub(playeridparams[])
{
    
SetPlayerStaminaSubVal(playeridstrval(params));
    return 
1;
}

public 
OnPlayerUpdate(playerid)
{
    new 
Float:stamina;
    if(!
IsPlayerNPC(playerid))
    {
        if(
sbtime[playerid] != gettime())
        {
            
GetPlayerStamina(playeridstamina);
            
SetPlayerProgressBarValue(playeridStaminaBar[playerid], stamina);
            
sbtime[playerid] = gettime();
        }
    }
    return 
1;

Reply


Messages In This Thread
stamina (control each player stamina) - by Lokii - 25.02.2019, 10:48
Re: stamina (control each player stamina) - by Injury - 25.02.2019, 12:55
Re: stamina (control each player stamina) - by Lokii - 25.02.2019, 13:15
Re: stamina (control each player stamina) - by Injury - 25.02.2019, 13:38
Re: stamina (control each player stamina) - by Lokii - 25.02.2019, 13:49
Re: stamina (control each player stamina) - by tysanio - 28.02.2019, 07:30
Re: stamina (control each player stamina) - by Lokii - 28.02.2019, 13:33
Re: stamina (control each player stamina) - by tysanio - 28.02.2019, 15:52

Forum Jump:


Users browsing this thread: 1 Guest(s)