GetPlayerMods
The mods the player’s game loaded - its Steam Workshop items and the folders of its Mods folder.
Read by the player’s game from its own record of the mods it enabled, with the id, name and version of each mod’s
mod.manifest. [mods] in server.toml already judged them when the player joined (any, an allow list or none); a
mode may refuse others on its own terms. The list is the client’s word - a modified game can leave a mod out - so
the rules that matter are the server’s own checks.
Syntax
Section titled “Syntax”GetPlayerMods(pid)| Parameter | Type | |
|---|---|---|
pid |
number | the player |
Returns
Section titled “Returns”table - a list of {id=, name=, version=, kb=} (kb = the size of the mod’s files); empty for none or when not connected
Example
Section titled “Example”function OnPlayerConnect(pid) for _, mod in ipairs(GetPlayerMods(pid)) do if mod.id == "cheatmenu" then Kick(pid, "please switch off " .. mod.name) return end endendSee also
Section titled “See also”OnPlayerConnect · Kick · the Players group of the index
