-
Notifications
You must be signed in to change notification settings - Fork 1
Callback & Controls
Ghecco edited this page Jul 10, 2020
·
1 revision
- called when the player's current stamina reaches 0.
public OnPlayerStaminaOver(playerid)
{
SetPlayerExhausted(playerid, true);
return 1;
}
- Check if the player is running,
true
if he runs, elsefalse
.
public OnPlayerUpdate(playerid)
{
if(IsPlayerRunning(playerid)) SendClientMessage(playerid, -1, "Running");
return 1;
}
- Get the player's PVAR "Exhausted", if it is 1 return
true
, elsefalse
.
public OnPlayerText(playerid, text[]))
{
if(IsPlayerExhausted(playerid)) SendClientMessage(playerid, -1, "You cannot speak if you are exhausted.");
return 1;
}
- Set the player's PVAR "Exhausted".
- If it is true, the player will do a recovery animation, time is defined by:
#define STAMINA_DEFAULT_RECOVERYTIME (4000)
public OnPlayerText(playerid, text[]))
{
if(IsPlayerExhausted(playerid)) SendClientMessage(playerid, -1, "You cannot speak if you are exhausted.");
return 1;
}