IsValidDoor: Difference between revisions

From Onset Developer Wiki
28days (talk | contribs)
No edit summary
No edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{Info|Function|Server & Client|1.0}}
{{Info|Function|Client & Server|1.0}}


{{FuncDescription|Checks whether a given door identifier is a valid door.}}
{{FuncDescription|Checks whether a given door identifier is a valid door.}}

Latest revision as of 13:56, 10 November 2021

IsValidDoor

Type: Function
Context: Client & Server
Introduced: v1.0

Description

Checks whether a given door identifier is a valid door.

Syntax

IsValidDoor(door)

Parameters

  • door
    The dooridentifier to check.

Return Value

  • Returns true on success.

Example

AddCommand("destroydoor", function(playerid, doorid)
	doorid = tonumber(doorid)
	if IsValidDoor(doorid) then
		return AddPlayerChat(playerid, "Invalid door Id specified.")
	end

	DestroyDoor(doorid)
	AddPlayerChat(playerid, "You destroyed the door ("..doorid..")")
	return
end)

See also