This repository was archived by the owner on Feb 19, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 39
TogglePlayerInfiniteRun
GtakillerIV edited this page Dec 8, 2014
·
2 revisions
Allows or denies a player from running without getting fatigue
playerid
The player's id.
bool:toggle
Whether to enable it or not.
Can be true
or false
.
0 if the player is not connected
CMD:togglerun(playerid, params[])
{
//If the player has the SA-MP+ plugin installed
if(IsUsingSAMPP(playerid))
{
static bool:infiniteEnergy[MAX_PLAYERS];
//If the player is already immune to tiredness
if(infiniteEnergy[playerid])
{
TogglePlayerInfiniteRun(playerid, false);
SendClientMessage(playerid, -1, "You are no longer immune from tiredness");
infiniteEnergy[playerid] = false;
}
//If not
else
{
TogglePlayerInfiniteRun(playerid, true);
SendClientMessage(playerid, -1, "You are now immune from tiredness");
infiniteEnergy[playerid] = true;
}
}
//If not
else
{
SendClientMessage(playerid, -1, "You need the SA-MP+ plugin");
}
return 1;
}
See Also