IsPlayerConnected: Difference between revisions

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search
Automatyczna aktualizacja dokumentacji funkcji
 
Complete Lua function catalog
 
Line 29: Line 29:
* Available only in server-side resource scripts.
* Available only in server-side resource scripts.


[[Category:Lua Functions]]
[[Category:Server Functions]]
[[Category:Server Functions]]
[[Category:Player Functions]]
[[Category:Player Functions]]

Latest revision as of 09:54, 15 August 2026

isPlayerConnected

Checks whether a player identifier belongs to a connected client.

Syntax

bool isPlayerConnected(int playerId)

Parameters

Name Type Required Description
playerId int yes The player identifier to check.

Returns

Returns true when the player is connected; otherwise returns false.

Examples

Validate a player before changing state:

if isPlayerConnected(playerId) then
    outputChatBox("You are connected", playerId)
end

Notes

  • Available only in server-side resource scripts.