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

STAMINA

This include allows you to control player's stamina, You can make fat skins get tired faster than slim skins etc...
How to include:

Код:
#define FILTERSCRIPT 
#define STAMINA_UPDATE_TIME //you can set you'r own update time by defining STAMINA_UPDATE_TIME before including stamina
#include <a_samp>
#include <stamina> //req y_hooks and foreach

//and you must add this callback: or you will get error.

public OnPlayerOutOfStamina(playerid)
{

    return 1;
}
Functions:

Код:
native SetPlayerStamina(playerid, Float:stamina);
native SetPlayerStaminaSubVal(playerid, Float:sub_val);
native GetPlayerStamina(playerid, &Float:stamina);
native GetPlayerStaminaSubVal(playerid);
Callbacks:

Код:
OnPlayerOutOfStamina(playerid)
Example:

1. make tired animation

PHP код:
#include <a_samp>
#include <stamina>
public OnPlayerOutOfStamina(playerid)
{
    
ApplyAnimation(playerid"PED""IDLE_tired"4.10110STAMINA_UPDATE_TIME*51);
    return 
1;

2. Player health decrease just like in GTA 5

PHP код:
#include <a_samp>
#include <stamina>
public OnPlayerOutOfStamina(playerid
{
    new 
Float:hp;
    
GetPlayerHealth(playeridhp); 
    
SetPlayerHealth(playeridhp-1.5);
    return 
1;

Video: https://www.youtube.com/watch?v=Zo8doDuZ6J4

Github: Click here

Download: Click here

requires:

y_hooks & foreach

Bugs:

If you find any bugs please report.


Credits:

SA-MP team - a_samp
****** - y_hooks & foreach
Lokii - stamina
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)