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
TogglePlayerInfiniteOxygen
GtakillerIV edited this page Nov 17, 2014
·
2 revisions
Allows or denies a player from having infinite oxygen levels
playerid
The player's id.
bool:toggle
Whether to allow the player to move or not.
Can be true
or false
.
0 if the player is not connected
CMD:toggleoxygen(playerid, params[])
{
//If the player has the SA-MP+ plugin installed
if(IsUsingSAMPP(playerid))
{
static bool:infiniteOxygen[MAX_PLAYERS];
//If the player is already has infinite oxygen levels
if(infiniteOxygen[playerid])
{
TogglePlayerInfiniteOxygen(playerid, false);
SendClientMessage(playerid, -1, "You no longer have infinite oxygen");
infiniteOxygen[playerid] = false;
}
//If not
else
{
TogglePlayerInfiniteOxygen(playerid, true);
SendClientMessage(playerid, -1, "You now have infinite oxygen");
infiniteOxygen[playerid] = true;
}
}
//If not
else
{
SendClientMessage(playerid, -1, "You need the SA-MP+ plugin");
}
return 1;
}
See Also