Skip to content

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.

GetPlayerMods(pid)
Parameter Type
pid number the player

table - a list of {id=, name=, version=, kb=} (kb = the size of the mod’s files); empty for none or when not connected

function OnPlayerConnect(pid)
for _, mod in ipairs(GetPlayerMods(pid)) do
if mod.id == "cheatmenu" then Kick(pid, "please switch off " .. mod.name) return end
end
end

OnPlayerConnect · Kick · the Players group of the index