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
TogglePlayerDriveOnWater
GtakillerIV edited this page Dec 2, 2014
·
8 revisions
Allows or denies a player from driving on water
This function only works for cars.
playerid
The player's id.
bool:toggle
Whether to allow access or not.
Can be true
or false
.
0 if the player is not connected
CMD:driveonwater(playerid, params[])
{
//If the player has SA-MP+ installed
if(IsUsingSAMPP(playerid))
{
static bool:driveOnWater[MAX_PLAYERS];
//If the player can already drive on water
if(driveOnWater[playerid])
{
SendClientMessage(playerid, -1, "You can no longer drive on water");
TogglePlayerDriveOnWater(playerid, 0);
driveOnWater[playerid] = false;
}
//If he can't
else
{
SendClientMessage(playerid, -1, "You can now drive on water");
TogglePlayerDriveOnWater(playerid, 1);
driveOnWater[playerid] = true;
}
}
//If not
else
{
SendClientMessage(playerid, -1, "You need the SA-MP+ plugin");
}
return 1;
}
See Also