-
Notifications
You must be signed in to change notification settings - Fork 1
Max Stamina
Ghecco edited this page Jul 10, 2020
·
2 revisions
Note:
The player's current stamina depends on his maximum stamina.
With these functions, if the current stamina is greater than the maximum stamina, it will be set as the latter.
- Get the player's maximum stamina, the maximum stamina is an
integar
.
public OnPlayerDisconnect(playerid, reason)
{
printf("The Player's Max Stamina value = %d", GetPlayerMaxStamina(playerid));
return 1;
}
- Add / Subtract the player's maximum stamina, the
value
is anintegar
. - The current stamina will never exceed the max stamina value.
public OnPlayerStaminaOver(playerid)
{
SetPlayerExhausted(playerid, true);
GivePlayerMaxStamina(playerid, 1);
return 1;
}
- Set the player's maximum stamina, the
value
is anintegar
. - The current stamina will never exceed the max stamina value.
public OnPlayerSpawn(playerid)
{
SetPlayerMaxStamina(playerid, -1); // When GivePlayerStamina or SetPlayerStamina is called they will also set the current stamina to -1.
return 1;
}