IsValidPlayer: Difference between revisions

From Onset Developer Wiki
(Created page with "{{Info|Function|Server|1.0}} {{FuncDescription|__EDIT_ME__}} {{FuncSyntax|IsValidPlayer(player)}} {{FuncParameters}} {{FuncParam|player|__EDIT_ME__}} {{FuncReturnValue|__E...")
 
No edit summary
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Info|Function|Server|1.0}}
{{Info|Function|Server & Client|1.0}}


{{FuncDescription|__EDIT_ME__}}
{{FuncDescription|Checks whether the specified player is connected to the server or not.}}


{{FuncSyntax|IsValidPlayer(player)}}
{{FuncSyntax|IsValidPlayer(player)}}


{{FuncParameters}}
{{FuncParameters}}
{{FuncParam|player|__EDIT_ME__}}
{{FuncParam|player|The player id}}


{{FuncReturnValue|__EDIT_ME__}}
{{FuncReturnValue|Returns '''true''' if the player is connected, otherwise '''false'''.}}


== Example ==
== Example ==
__EDIT_ME__
<syntaxhighlight lang="Lua>
print("Valid Player: " .. IsValidPlayer(player) and "Yes" or "No")
</syntaxhighlight>


{{RelatedFunctions}}
{{RelatedFunctions}}
__EDIT_ME__
{{ServerPlayerFunctions}}

Latest revision as of 14:38, 26 June 2021

IsValidPlayer

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

Description

Checks whether the specified player is connected to the server or not.

Syntax

IsValidPlayer(player)

Parameters

  • player
    The player id

Return Value

  • Returns true if the player is connected, otherwise false.

Example

print("Valid Player: " .. IsValidPlayer(player) and "Yes" or "No")

See also