25.02.2019, 10:48
(
Последний раз редактировалось Lokii; 18.04.2019 в 00:54.
)
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:This include allows you to control player's stamina, You can make fat skins get tired faster than slim skins etc...
Код:
#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; }
Код:
native SetPlayerStamina(playerid, Float:stamina); native SetPlayerStaminaSubVal(playerid, Float:sub_val); native GetPlayerStamina(playerid, &Float:stamina); native GetPlayerStaminaSubVal(playerid);
Код:
OnPlayerOutOfStamina(playerid)
1. make tired animation
PHP код:
#include <a_samp>
#include <stamina>
public OnPlayerOutOfStamina(playerid)
{
ApplyAnimation(playerid, "PED", "IDLE_tired", 4.1, 0, 1, 1, 0, STAMINA_UPDATE_TIME*5, 1);
return 1;
}
PHP код:
#include <a_samp>
#include <stamina>
public OnPlayerOutOfStamina(playerid)
{
new Float:hp;
GetPlayerHealth(playerid, hp);
SetPlayerHealth(playerid, hp-1.5);
return 1;
}
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