Skip to content
iFarbod edited this page Jun 28, 2014 · 4 revisions

IsPlayerPaused(playerid);

Detects Player paused or not.

This function is available since R8. Not works in earlier versions.

Parameters:

  • playerid : Player ID To check pause status.

Return Values:

  • Returns 0 if server version unknown.
  • Returns 1 if player paused (accuracy : 100%).
  • Returns 0 also else if player NOT paused (accuracy : 100%).

Example Usage :

CMD:ispaused(playerid, params[])
{
	new
		targetid;

	if(!IsPlayerAdmin(playerid)) return 0; // Change this to whatever.
	if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "Syntax: /ispaused [Player ID/Player Name/Part of Player Name]");
	if(!IsPlayerConnected(targetid) && targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "That player isn't connected!");

	switch(IsPlayerPaused(targetid))
	{
		case 0: SendClientMessage(playerid, -1, "Not-PAUSED!");
		case 1: SendClientMessage(playerid, -1, "PAUSED!");
	}

	return 1;
}