GetElementsByType: 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:52, 15 August 2026

getElementsByType

Returns elements of a supported server-side type.

Syntax

table getElementsByType(string elementType)

Parameters

Name Type Required Description
elementType string yes The element type. Currently player is supported.

Returns

Returns a 1-indexed array of matching identifiers. Unsupported types return an empty table.

Examples

Iterate over all player elements:

for _, playerId in ipairs(getElementsByType("player")) do
    print(playerId)
end

Notes

  • Available only in server-side resource scripts.