This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function switch(t) | |
t.case = function (self,x, p, com) | |
local f=self[x] or self.default | |
if f then | |
if type(f)=="function" then | |
f(p, x, com) | |
else | |
error("case "..tostring(x).." not a function") | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
description = {} | |
description.credits = | |
[[ | |
Author: Lee Gao | |
License: Creative Common | |
Title: CS2D Enhanced Mod System | |
]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Example Port of Stiil's LDM into AMX2D | |
-------------------------------------------------- | |
-- Laser Deathmatch Script by STIIL -- | |
-- 31.03.2009 - www.pavi.890m.com -- | |
-------------------------------------------------- | |
init_mod("ldm") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--server.lua | |
local dir = "sys/lua/amx2d" | |
dofile(dir.."main.lua") | |
main(dir) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if load(mod_dir.."mod_quakeMod") then | |
print("mod_quakeMod.lua successfully loaded") | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
init_mod("echo") | |
echo.var("prefix","Server echoed: ", "svar") | |
function act_echo(p, typ, cmd) | |
msg(p, echo.prefix..cmd) | |
end | |
return echo.name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
init_mod("sample_move") | |
function hook_move_sample(p, x, y) | |
parse(string.format("hudtxt2 %s 1 %sPlayer '%s' is at (%s, %s) 100 100 1", p, Color(255, 100, 0), player(p, "name"), x, y)) | |
end | |
toMod("sample_move") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if flacko==nil then flacko={} end | |
flacko.admins={} | |
function flacko.admins.split(t,b) | |
return toTable() | |
end | |
function toTable(t, b) --By leegao-- | |
local cmd = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from waveapi import events, robot | |
def _register(self, event): | |
def _wrapper(fn): | |
self.RegisterHandler(events.__getattribute__(event), fn) | |
return _wrapper | |
robot.Robot.register = _register | |
""" | |
#Sample usage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Initialize | |
init_mod("sv") | |
sv.var("prefix","Server echoed: ", "svar") | |
sv.var("broadcasttimeout", 60, "svar") | |
sv.var("debug", 0, "svar") | |
sv.var("buy", 1, "svar") | |
sv.var("drop", 1, "svar") | |
sv.var("collect", 1, "svar") | |
sv.broadcasttime = initArray(32) |
OlderNewer