Skip to content
This repository has been archived by the owner on Feb 19, 2020. It is now read-only.

ToggleUnderwaterEffect

GtakillerIV edited this page Dec 21, 2014 · 2 revisions

ToggleUnderwaterEffect

Enables or disables the "Underwater effect" for a player


Parameters

playerid

The player's id.

bool:toggle

Whether to enable it or not.

Can be true or false.

Returns

    0 if the player is not connected

Usage

CMD:togglewatereffect(playerid, params[])
{
	//If the player has the SA-MP+ plugin installed
	if(IsUsingSAMPP(playerid))
	{
		new bool:toggle;
		if(sscanf(params, "b", toggle)) return SendClientMessage(playerid, -1, "Correct usage: /togglewatereffect 1/0");

		ToggleUnderwaterEffect(playerid, toggle);

		if(toggle)
			SendClientMessage(playerid, -1, "Underwater effect is now enabled");
		else
			SendClientMessage(playerid, -1, "Underwater effect has been disabled");

	}
	//If not
	else
	{
		SendClientMessage(playerid, -1, "You need the SA-MP+ plugin");
	}

	return 1;
}

See Also

ToggleNightVision

ToggleThermalVision

TogglePlayerDriveOnWater

Clone this wiki locally