-- Simple LUA Script to print Server rules and some other useful informations to the clients who type /rules
-- Script by N!trox* - Report any bugs or post any suggestion on N!tmod forum : www.nitmod.com
-- Changelog : 
-- Version 1.0
-- > Initial version
--	> /rules
--	> /website

--Refister the mod
function et_InitGame(levelTime,randomSeed,restart)
	et.RegisterModname("Rules")
end

-- Set to 0 if you want to disable these commands
USE_RULES = 1
USE_WEBSITE = 1

-- Set NUMRULES to the number of rules that will be printed in the client console
NUMRULES = 4

-- Add a new line for each rule.
-- Make sure you set NUMRULES value above to the correct number of rules.
rules = {
	"Rule # 1",
	"Rule # 2",
	"Rule # 3",
	"Rule # 4"
}

-- Used for /website (print a website URL in the client's console)
-- Define your website URL below
WEBSITE = "www.nitmod.com"

function et_ClientCommand(clientNum, command)
	command = string.lower(command)
		--If a client types "/rules" in his console
		if (command == "rules") and (USE_RULES == 1) then
			for i=1,(NUMRULES),1 do
				et.trap_SendServerCommand(clientNum, "print \"" .. rules[i] .."^7\n\"")
			end
		return 1
		--If a client types "/website in his console
		elseif (command == "website") and (USE_WEBSITE == 1) then
				et.trap_SendServerCommand(clientNum, "print \"" .. WEBSITE .."^7\n\"")
				return 1
		end
end
