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

TogglePauseMenuAbility

GtakillerIV edited this page Nov 15, 2014 · 5 revisions

TogglePauseMenuAbility

Allows or denies access to the pause menu

Note If a player tries to enter the main menu while he/she has no permission to, the mouse will stop working.


Parameters

playerid

The player's id.

bool:toggle

Whether to allow access or not.

Can be true or false.

Returns

    0 if the player is not connected

Usage

CMD:togglepause(playerid, params[])
{
	new targetid, bool:toggle;
	if(sscanf(params, "ub", targetid, toggle)) return SendClientMessage(playerid, -1, "Correct usage: /togglepause playerid 1/0");

	if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "The requested player is not connected");
	if(!IsUsingSAMPP(targetid)) return SendClientMessage(playerid, -1, "The requested player doesn't have the SA-MP+ plugin installed");

	TogglePauseMenuAbility(playerid, toggle);

	SendClientMessage(playerid, -1, "The requested player will now/not be able to view the main menu");

	return 1;
}

See also

IsPlayerInPauseMenu

TogglePlayerFrozen

TogglePlayerSwitchReload

Callbacks

OnPlayerOpenPauseMenu

OnPlayerClosePauseMenu

OnPlayerEnterPauseSubmenu

Clone this wiki locally