ETMods.net

N!tmod, a Wolfenstein: Enemy Territory Modification!

You are not logged in.

Announcement

You can donate to help us keeping services online.

#1 31-Mar-10 03:29:09

N!trox*
Administrator
Registered: 30-Mar-10
Posts: 1,098

Re: rules.lua

This is my FIRST script ever, it used to be a test because I wanted to learn how to make them.

Afterall it became a script that can be useful for a lot of server admins.

This script has been made to print server rules (defined inside the script by admins) to clients who will type /rules in their console.

I also added a feature to print a website URL (also defined in the script) when typing /website in the console.

There are a few comments in the script which will explain how to use it.

If you want any new features, just post them here.

Here's the download link :

rules.lua

Enjoy smile


iluvnitmod.png

Offline

#2 31-Mar-10 11:47:28

YCN'Adrian
Member
Registered: 31-Mar-10
Posts: 11

Re: rules.lua

Hello,

This is a great script :)matey.

Regards,
Adrian

Offline

#3 24-Dec-11 02:55:13

Dragonji
Member
From: Poland
Registered: 19-Aug-10
Posts: 88
Website

Re: rules.lua

Link is dead.

Offline

#4 25-Dec-11 01:33:17

N!trox*
Administrator
Registered: 30-Mar-10
Posts: 1,098

Re: rules.lua

Oops.

For broken links, don't forget to check ETMods.net "Downloads" section.

Here's the LUA Downloads section:
http://etmods.net/index.php/dl/category/2-lua-modules

By the way I have to add some new scripts that i made there yikes


iluvnitmod.png

Offline

#5 03-Sep-12 03:44:14

jay1110
BETA Tester
Registered: 01-Sep-12
Posts: 239
Website

Re: rules.lua

the lua download section is down,

and this script doesnt work http://etmods.net/downloads/lua/rules.lua gives a syntax error


this is the fixed script ( i just added at line 1 and 2 the -- )

-- Simple LUA Script to print Server rules and some other useful informations to the clients who type /rules or /website
-- Script by N!trox* - Report any bugs or post any suggestion on N!tmod forum : http://etmods.net/nitmod
-- 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 = "http://etmods.net"

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

Offline

Board footer

Powered by FluxBB