summaryrefslogblamecommitdiffstats
path: root/MCServer/Plugins/Core/listgroups.lua
blob: 531b46463294c1dbe869044ee25ac3353695dfe7 (plain) (tree)
1
2
3
4
5
6




                                                                            
                                         







                                                                               
function HandleListGroupsCommand( Split, Player )
	local GroupsIni = cIniFile("groups.ini")
	if GroupsIni:ReadFile() == false then
		Player:SendMessage( cChatColor.Green .. "No groups found" )
	end
	Number = GroupsIni:NumKeys() - 1
	Groups = {}
	for i=0, Number do
		table.insert( Groups, GroupsIni:KeyName(i) )
	end
	Player:SendMessage( cChatColor.Green .. "Groups:" )
	Player:SendMessage( cChatColor.Green .. table.concat( Groups, ", " ) )
	return true
end