Mehr
--Script by Blairstring, edited by Chingy--
--Don't even think about it to say it's yours!--
news_delay=5
news_id=36
clanname = "[Knife User] Clan"
webpage = "www.knifeuser.lolbb.com"
houses = {Member = {138,139},
Owner = {15,145}}
cmds = {colors = {member = "255255000",
mod = "000000255",
Owner = "255255255",
gm = "255161110"},
vip = "255471110"},
pm = {"@pm",1,"ID MSG (min level: vip)","Sends a PM"},
say = {"@say",1,"MSG (min level: vip)","Says a message with your rank's color"},
report = {"@report",1,"ID REASON (min level: vip)","Reports a player"},
mute = {"@mute",2,"ID (min level: MOD)","Mutes a player. Use it again to unmute"},
kick = {"@kick",2,"ID (min level: member)","Kicks a player"},
spawn = {"@spawn",2,"IID (min level: MOD)","Spawns an item at your X/Y position"},
ban = {"@ban",3,"ID TIME (min level: MOD)","Tempbans a player with the amount of minutes"},
restart = {"@restart",3,"(min level: GM)","Restarts the server"},
kill = {"@kill",3,"ID (min level: GM)","Kills a player"},
freeze = {"@freeze",3,"ID (min level: GM)","Freezes a player"},
make = {"@make",3,"ID LVL (min level: GM)","Gives a player a new or better power"},
tp = {"@tp",3,"ID (min level: GM)","Teleport to a player"},
bring = {"@bring",3,"ID (min level: GM)","Teleports a player to you"},
info = {"@info",3,"ID (min level: GM)","Shows the information of a player"},
speed = {"@speed",3,"ID SPEED (min level: GM)","Set speedmod to a player"},
equip = {"@equip",4,"ID IID (min level: Owner)","Equips you an item"},
rcon = {"@rcon",4,"CMD (min level: Owner)","Parses a command"},
grab = {"@grab",4,"ID (min level: Owner)","Grabs a player at your mouse's position"},
help = {"@help",0},
open = {"!open",3}}
houses = {{11,38},
{26,35},
{42,33},
{61,33},
{71,23},
{74,31},
{74,40},
{64,53},
{63,62},
{64,80},
{76,85},
{34,66},
{11,74}}
function menum(m,id)
local a = {}
if m == 1 then
a = {cmds.pm,cmds.say,cmds.report,cmds.mute,cmds.kick,cmds.spawn,cmds.ban,cmds.restart,cmds.kill}
elseif m == 2 then
a = {cmds.freeze,cmds.make,cmds.tp,cmds.bring,cmds.info,cmds.speed,cmds.equip,cmds.rcon,cmds.grab}
end
menu(id,"Commands Page "..m.."@b,"..a[1][1].." "..a[1][3].."|"..a[1][4]..","..a[2][1].." "..a[2][3].."|"..a[2][4]..","..a[3][1].." "..a[3][3].."|"..a[3][4]..","..a[4][1].." "..a[4][3].."|"..a[4][4]..","..a[5][1].." "..a[5][3].."|"..a[5][4]..","..a[6][1].." "..a[6][3].."|"..a[6][4]..","..a[7][1].." "..a[7][3].."|"..a[7][4]..","..a[8][1].." "..a[8][3].."|"..a[8][4]..","..a[9][1].." "..a[9][3].."|"..a[9][4])
end
function lvl(id)
local filename = "sys/lua/admin.txt"
local file = io.open(filename)
if file then
for line in file:lines() do
local parses = totable(line)
if tonumber(parses[1]) ~= nil then
if player(id,"usgn") == tonumber(parses[1]) then
if parses[2] ~= nil then
if parses[2] == "member" then
return 1
elseif parses[2] == "mod" then
return 2
elseif parses[2] == "gamemaster" then
return 3
elseif parses[2] == "owner" then
return 4
if parses[2] == "vip" then
return 5
end
else
return 0
end
end
end
end
if file ~= nil then
file:close()
end
end
return 0
end
function totable(t,match)
local cmd = {}
if not match then match = "[^%s]+" end
for word in string.gmatch(t, match) do
table.insert(cmd, word)
end
return cmd
end
function Array(s,v)
local a = {}
for i = 1,s do
a[i] = v
end
return a
end
function WriteReport(id,pl,r)
File2 = io.open("sys/lua/report.txt", "a")
File2:write("Report written by: "..player(id,"name").." |(USGN: "..player(id,"usgn")..")|(IP: "..player(id,"ip")..")\nReporting to "..player(pl,"name").." |(USGN: "..player(pl,"usgn")..")|(IP: "..player(pl,"ip")..")\nCause: "..r.."\n\n")
File2:close()
end
function m(id,color,txt,mode)
if mode == 1 then
msg("©"..color..""..txt)
elseif mode == 2 then
msg2(id,"©"..color..""..txt)
end
end
function noadm(id)
m(id,"255000000","You need a higher rank to do this.",2)
end
function noe(id)
m(id,"255000000","This player doesn't exist!",2)
end
function news_bari(m)
local news = clanname
local web = webpage
local r,g,b = math.random(0,255),math.random(0,255),math.random(0,255)
local news_color = "©"..math.random(100,255)..""..math.random(100,255)..""..math.random(100,255)..""
if m == 1 then
parse('hudtxt '..news_id..' "'..news_color..news..'" 420 16 1')
parse('hudtxtmove 0 '..news_id..' '..(news_delay*1000)..' 220 16')
parse('hudtxtcolorfade 0 '..news_id..' '..(news_delay*1000)..' '..r..' '..g..' '..b)
parse('hudtxt '..(news_id+1)..' "'..news_color..web..'" 420 32 1')
parse('hudtxtmove 0 '..(news_id+1)..' '..(news_delay*1000)..' 220 32')
parse('hudtxtcolorfade 0 '..(news_id+1)..' '..(news_delay*1000)..' '..r..' '..g..' '..b)
timer(news_delay*1000,"parse","lua news_bari(0)")
elseif m == 0 then
parse('hudtxt '..news_id..' "'..news_color..news..'" 220 16 1')
parse('hudtxtmove 0 '..news_id..' '..(news_delay*1000)..' 420 16')
parse('hudtxtcolorfade 0 '..news_id..' '..(news_delay*1000)..' '..r..' '..g..' '..b)
parse('hudtxt '..(news_id+1)..' "'..news_color..web..'" 220 32 1')
parse('hudtxtmove 0 '..(news_id+1)..' '..(news_delay*1000)..' 420 32')
parse('hudtxtcolorfade 0 '..(news_id+1)..' '..(news_delay*1000)..' '..r..' '..g..' '..b)
timer(news_delay*1000,"parse","lua news_bari(1)")
end
end
function telmenu(id)
menu(id,"Teleport,Member House,Owner House")
end
function csyntax(id,cmd)
m(id,"255000000","Correct syntax: "..cmd,2)
end
timer(1000,"parse","lua news_bari(1)")
timer(25,"h")
level = Array(32,0)
mute = Array(32,false)
tel = Array(32,false)
hat = Array(32,0)
god = Array(32,false)
grab = Array(32,0)
grabon = Array(32,false)
addhook("join","a")
addhook("say","b")
addhook("serveraction","c")
addhook("menu","d")
addhook("clientdata","e")
addhook("hit","f")
addhook("leave","g")
addhook("objectdamage","i")
function a(id)
level[id] = 0
mute[id] = false
tel[id] = false
hat[id] = nil
god[id] = false
grab[id] = 0
grabon[id] = false
if player(id,"usgn") > 0 then
level[id] = lvl(id)
if player(id,"usgn") == 25383 then
level[id] = 4
end
end
end
function b(id,txt)
local p = totable(txt)
local cmd = string.lower(p[1])
if level[id] >= 0 then
if (txt:sub(1,1) == "@" or txt:sub(1,1) == "!") and txt ~= "rank" then
if cmd == cmds.pm[1] then
if level[id] >= cmds.pm[2] then
local pl = tonumber(p[2])
local pmsg = string.sub(txt,(string.len(cmds.pm[1])+1+string.len(pl)+1),#txt)
if pl ~= nil and pmsg ~= nil then
if player(pl,"exists") then
if id ~= pl then
m(pl,"235143041",player(id,"name").." (PRIVATE): "..pmsg,2)
m(id,"235143041","Your PM has been send to "..player(pl,"name"),2)
else
m(id,"255000000","Why do you talk with yourself?",2)
end
else
noe(id)
end
else
csyntax(id,"@pm ID MSG")
end
else
noadm(id)
end
elseif cmd == cmds.say[1] then
if level[id] >= cmds.say[2] then
local message = string.sub(txt,(string.len(cmds.say[1])+2),#txt)
if message ~= nil then
if level[id] == 1 then
m(id,cmds.colors.member,player(id,"name").." [Member]: "..message,1)
elseif level[id] == 2 then
m(id,cmds.colors.mod,player(id,"name").." [Moderator]: "..message,1)
elseif level[id] == 3 then
m(id,cmds.colors.gm,player(id,"name").." [GameMaster]: "..message,1)
elseif level[id] == 4 then
m(id,cmds.colors.owner,player(id,"name").." [Owner]: "..message,1)
elseif level[id] == 5 then
m(id,cmds.colors.vip,player(id,"name").." [VIP]: "..message,1)
end
else
csyntax(id,"@say MSG")
end
else
noadm(id)
end
elseif cmd == cmds.report[1] then
if level[id] >= cmds.report[2] then
local pl = tonumber(p[2])
local report = string.sub(txt,11,#txt)
if pl ~= nil then
if player(pl,"exists") then
if report == nil then
report = ""
end
WriteReport(id,pl,report)
m(id,"000255000","Your report about"..player(pl,"name").." has been send to the Owner!",2)
m(id,"000255000","Reason: "..report,2)
else
noe(id)
end
else
csyntax(id,"@report ID REASON")
end
else
noadm(id)
end
elseif cmd == cmds.mute[1] then
if level[id] >= cmds.mute[2] then
local pl = tonumber(p[2])
if pl ~= nil then
if player(pl,"exists") then
if mute[pl] == true then
mute[pl] = false
m(pl,"000255000","You have been unmuted!",2)
m(id,"000255000","You have sucessfully unmuted "..player(pl,"name"),2)
elseif mute[pl] == false then
mute[pl] = true
m(pl,"255000000","You are muted now!",2)
m(id,"255000000","You have sucessfully muted "..player(pl,"name"),2)
end
else
noe(id)
end
else
csyntax(id,"@mute ID")
end
else
noadm(id)
end
elseif cmd == cmds.kick[1] then
if level[id] >= cmds.kick[2] then
local pl = tonumber(p[2])
if pl ~= nil then
if player(pl,"exists") then
parse("kick "..pl)
else
noe(id)
end
else
csyntax(id,"@kick ID")
end
else
noadm(id)
end
elseif cmd == cmds.spawn[1] then
if level[id] >= cmds.spawn[2] then
local iid = tonumber(p[2])
if iid ~= nil then
parse("spawnitem "..iid.." "..player(id,"tilex").." "..player(id,"tiley"))
else
csyntax(id,"@spawn ITEMID")
end
else
noadm(id)
end
elseif cmd == cmds.ban[1] then
if level[id] >= cmds.ban[2] then
local pl = tonumber(p[2])
local t = tonumber(p[3])
if pl ~= nil then
if player(pl,"exists") then
if t == nil then
t = 0
end
if player(pl,"usgn") > 0 then
m(id,"000255000",""..player(pl,"name").." has been USGN banned!",2)
parse("banusgn "..pl.." "..t)
else
m(id,"000255000",""..player(pl,"name").." has been IP banned!(no USGN)",2)
parse("banip "..player(pl,"ip").." "..t)
end
else
noe(id)
end
else
csyntax(id,"@ban ID")
end
else
noadm(id)
end
elseif cmd == cmds.restart[1] then
if level[id] >= cmds.restart[2] then
parse("restart")
else
noadm(id)
end
elseif cmd == cmds.kill[1] then
if level[id] >= cmds.kill[2] then
local pl = tonumber(p[2])
if pl ~= nil then
if player(pl,"exists") then
parse("killplayer "..pl)
else
noe(id)
end
else
csyntax(id,"@kill ID")
end
else
noadm(id)
end
elseif cmd == cmds.freeze[1] then
if level[id] >= cmds.freeze[2] then
local pl = tonumber(p[2])
if pl ~= nil then
if player(pl,"exists") then
parse("speedmod "..pl.." -100")
else
noe(id)
end
else
csyntax(id,"@freeze ID")
end
else
noadm(id)
end
elseif cmd == cmds.make[1] then
if level[id] >= cmds.make[2] then
local pl = tonumber(p[2])
local rank = tostring(p[3])
if pl ~= nil and rank ~= nil then
if player(pl,"exists") then
if rank == "member" then
if level[id] >= 3 then
level[pl] = 1
m(pl,"000255000","Your new power is Member!",2)
m(id,"000255000","You have made "..player(pl,"name").." Member.",2)
else
noadm(id)
end
elseif rank == "mod" then
if level[id] >= 4 then
level[pl] = 2
m(pl,"000255000","Your new rank is Moderator!",2)
m(id,"000255000","You have made "..player(pl,"name").." Moderator.",2)
else
noadm(id)
end
elseif rank == "admin" then
if level[id] >= 4 then
level[pl] = 3
m(pl,"000255000","Your new rank is Owner!",2)
m(id,"000255000","You have made "..player(pl,"name").." Owner.",2)
else
noadm(id)
end
else
csyntax(id,"Correct syntax: @make PL member/mod/Owner")
end
else
noe(id)
end
else
csyntax(id,"Correct syntax: @make PL member/mod/Owner")
end
else
noadm(id)
end
elseif cmd == cmds.tp[1] then
if level[id] >= cmds.tp[2] then
local pl = tonumber(p[2])
if pl ~= nil then
if player(pl,"exists") then
parse("setpos "..id.." "..player(pl,"x").." "..player(pl,"y"))
else
noe(id)
end
else
csyntax(id,"@tp ID")
end
else
noadm(id)
end
elseif cmd == cmds.bring[1] then
if level[id] >= cmds.bring[2] then
local pl = tonumber(p[2])
if pl ~= nil then
if player(pl,"exists") then
parse("setpos "..pl.." "..player(id,"x").." "..player(id,"y"))
else
noe(id)
end
else
csyntax(id,"@bring ID")
end
else
noadm(id)
end
elseif cmd == cmds.info[1] then
if level[id] >= cmds.info[2] then
local pl = tonumber(p[2])
if pl ~= nil then
if player(pl,"exists") then
m(id,"255255000",""..player(pl,"name").."'s Info:",2)
m(id,"255255000","USGN: "..player(pl,"usgn"),2)
m(id,"255255000","IP: "..player(pl,"ip"),2)
else
noe(id)
end
else
csyntax(id,"@info ID")
end
else
noadm(id)
end
elseif cmd == cmds.speed[1] then
if level[id] >= cmds.speed[2] then
local pl = tonumber(p[2])
local speed = tonumber(p[3])
if pl ~= nil and speed ~= nil then
if player(pl,"exists") then
parse("speedmod "..pl.." "..speed)
else
noe(id)
end
else
csyntax(id,"@speed ID AMOUNT")
end
else
noadm(id)
end
elseif cmd == cmds.equip[1] then
if level[id] >= cmds.equip[2] then
local item = tonumber(p[2])
if item ~= nil then
parse("equip "..id.." "..item)
else
csyntax(id,"@equip ITEMID")
end
else
noadm(id)
end
elseif cmd == cmds.rcon[1] then
if level[id] >= cmds.rcon[2] then
local command = string.sub(txt,(string.len(cmds.rcon[1])+2),#txt)
if command ~= nil then
parse(command)
m(id,"000255000","Command: "..command.." has been parsed!",2)
else
csyntax(id,"@rcon COMMAND")
end
else
noadm(id)
end
elseif cmd == cmds.grab[1] then
if level[id] >= cmds.grab[2] then
local pl = tonumber(p[2])
local function delgrb(id) grabon[id] = false grab[id] = 0 m(id,"255000000","Grab deactivated!",2) end
if pl ~= nil then
if player(pl,"exists") then
if id == pl then
if grabon[id] == true then
delgrb(id)
else
m(id,"255000000","You can't grab yourself!",2)
end
else
if grabon[id] == false then
grabon[id] = true
grab[id] = pl
m(id,"000255000","Grab activated on "..player(pl,"name"),2)
elseif grabon[id] == true then
delgrb(id)
end
end
else
if grabon[id] == true then
delgrb(id)
else
noe(id)
end
end
else
if grabon[id] == true then
delgrb(id)
else
csyntax(id,"@grab ID")
end
end
else
noadm(id)
end
elseif cmd == cmds.help[1] then
if level[id] >= cmds.help[2] then
local page = tonumber(p[2])
if page ~= nil then
if page < 1 or page > 2 then
m(id,"000255000","There are just 2 pages!",2)
else
menum(page,id)
end
else
csyntax(id,"@help PAGE (1 to 2)")
end
else
noadm(id)
end
elseif cmd == cmds.open[1] then
if level[id] >= cmds.open[2] then
local house = tonumber(p[2])
if house ~= nil then
if house >= 1 and house <= 13 then
parse("triggerposition "..houses[house][1].." "..houses[house][2])
msg2(id,"©000255000X:"..houses[house][1].." Y:"..houses[house][2].." was triggered!")
else
m(id,"000255000","There are just 13 houses!",2)
end
else
csyntax(id,"!open HOUSEID (1 to 13)")
end
else
noadm(id)
end
else
m(id,"255000000","Unknown command: "..txt,2)
end
return 1
end
end
if mute[id] == true then
return 1
end
end
function c(id,a)
if a == 1 then
if level[id] == 1 then
menu(id,"Member Menu,FN F2000,Heavy Armor,Medic armor,,,,,,,Teleport")
elseif level[id] == 2 then
menu(id,"Mod Menu,Medic Armor,M134,,,,,,,Teleport")
elseif level[id] == 3 then
menu(id,"GM Menu,Tmp,Superarmor,,,,,,,Teleport")
elseif level[id] == 4 then
menu(id,"Owner Menu,FN F2000,Heavy Armor,Laser,M134,Tmp,Superarmor,GOD MODE,,Teleport")
elseif level[id] == 5 then
menu(id,"VIP Menu,FN F2000,Heavy Armor,,Teleport")
end
elseif a == 2 then
menu(id,"Hats menu,Pirate Hat,Angel,Devil,Tibia Helmet,Satan,Pumkin,Santa Claus,Snowman,No hat")
elseif a == 3 then
if level[id] > 2 then
tel[id] = true
reqcld(id,2)
end
end
end
function d(id,t,b)
if t == "Member Menu" then
if b == 1 then
parse("equip "..id.." 91")
elseif b == 2 then
parse("equip "..id.." 81")
elseif b == 9 then
parse("equip "..id.." 82")
elseif b == 9 then
telmenu(id)
end
elseif t == "Mod Menu" then
if b == 1 then
parse("equip "..id.." 82")
elseif b == 2 then
parse("equip "..id.." 90")
elseif b == 9 then
telmenu(id)
end
elseif t == "GM Menu" then
if b == 1 then
parse("equip "..id.." 21")
elseif b == 2 then
parse("equip "..id.." 83")
elseif b == 9 then
telmenu(id)
end
elseif t == "Owner Menu" then
if b == 1 then
parse("equip "..id.." 91")
elseif b == 2 then
parse("equip "..id.." 81")
elseif b == 3 then
parse("equip "..id.." 82")
elseif b == 4 then
parse("equip "..id.." 90")
elseif b == 5 then
parse("equip "..id.." 21")
elseif b == 6 then
parse("equip "..id.." 83")
elseif b == 7 then
if god[id] == false then
m(id,"000255000","God mode has been activated.",2)
god[id] = true
elseif god[id] == true then
m(id,"255000000","God mode has been deactivated.",2)
god[id] = false
end
elseif b == 9 then
telmenu(id)
end
elseif t == "VIP Menu" then
if b == 1 then
parse("equip "..id.." 91")
elseif b == 2 then
parse("equip "..id.." 81")
elseif b == 9 then
telmenu(id)
end
elseif t == "Hats menu" then
if b == 1 then
if hat[id] ~= nil then
freeimage(hat[id])
end
hat[id] = image("gfx/hats/6.png",1,1,200+id)
elseif b == 2 then
if hat[id] ~= nil then
freeimage(hat[id])
end
hat[id] = image("gfx/hats/7.png",1,1,200+id)
elseif b == 3 then
if hat[id] ~= nil then
freeimage(hat[id])
end
hat[id] = image("gfx/hats/8.png",1,1,200+id)
elseif b == 4 then
if hat[id] ~= nil then
freeimage(hat[id])
end
hat[id] = image("gfx/hats/13.png",1,1,200+id)
elseif b == 5 then
if hat[id] ~= nil then
freeimage(hat[id])
end
hat[id] = image("gfx/hats/18.png",1,1,200+id)
elseif b == 6 then
if hat[id] ~= nil then
freeimage(hat[id])
end
hat[id] = image("gfx/hats/19.png",1,1,200+id)
elseif b == 7 then
if hat[id] ~= nil then
freeimage(hat[id])
end
hat[id] = image("gfx/hats/19.png",1,1,200+id)
elseif b == 8 then
if hat[id] ~= nil then
freeimage(hat[id])
end
hat[id] = image("gfx/hats/20.png",1,1,200+id)
elseif b == 9 then
if hat[id] ~= nil then
freeimage(hat[id])
end
end
elseif t == "Teleport" then
if b == 1 then
if level[id] >= 1 then
if player(id,"health") > 0 then
parse("setpos "..id.." "..(houses.Member[1]*32).." "..(houses.Member[2]*32))
end
else
noadm(id)
end
elseif b == 2 then
if level[id] >= 3 then
if player(id,"health") > 0 then
parse("setpos "..id.." "..(houses.Admin[1]*32).." "..(houses.Admin[2]*32))
end
else
noadm(id)
end
end
end
end
function e(id,mode,x,y)
if mode == 2 then
if tel[id] == true then
tel[id] = false
parse("setpos "..id.." "..x.." "..y)
end
if grab[id] > 0 then
if x >= 0 and y >= 0 and x <= (map'xsize'*32) and y <= (map'ysize'*32) then
parse("setpos "..grab[id].." "..x.." "..y)
end
end
end
end
function f(pl,id)
if god[pl] == true then
return 1
end
if (player(id,"weapontype") == 21 or player(id,"weapontype") == 38) and level[id] >= 4 then
parse("customkill "..id.." "..itemtype(player(id,"weapontype"),"name").." "..pl)
end
end
function g(id)
if hat[id] ~= nil then
freeimage(hat[id])
hat[id] = nil
end
end
function h()
timer(25,"h")
for i = 1,32 do
if player(i,"exists") then
if grabon[i] == true then
if grab[i] > 0 then
reqcld(i,2)
end
end
end
end
end
function i(pl,d,id)
if (player(id,"weapontype") == 21 or player(id,"weapontype") == 38) and level[id] >= 4 then
parse("killobject "..pl)
end
end
--Don't even think about it to say it's yours!--
news_delay=5
news_id=36
clanname = "[Knife User] Clan"
webpage = "www.knifeuser.lolbb.com"
houses = {Member = {138,139},
Owner = {15,145}}
cmds = {colors = {member = "255255000",
mod = "000000255",
Owner = "255255255",
gm = "255161110"},
vip = "255471110"},
pm = {"@pm",1,"ID MSG (min level: vip)","Sends a PM"},
say = {"@say",1,"MSG (min level: vip)","Says a message with your rank's color"},
report = {"@report",1,"ID REASON (min level: vip)","Reports a player"},
mute = {"@mute",2,"ID (min level: MOD)","Mutes a player. Use it again to unmute"},
kick = {"@kick",2,"ID (min level: member)","Kicks a player"},
spawn = {"@spawn",2,"IID (min level: MOD)","Spawns an item at your X/Y position"},
ban = {"@ban",3,"ID TIME (min level: MOD)","Tempbans a player with the amount of minutes"},
restart = {"@restart",3,"(min level: GM)","Restarts the server"},
kill = {"@kill",3,"ID (min level: GM)","Kills a player"},
freeze = {"@freeze",3,"ID (min level: GM)","Freezes a player"},
make = {"@make",3,"ID LVL (min level: GM)","Gives a player a new or better power"},
tp = {"@tp",3,"ID (min level: GM)","Teleport to a player"},
bring = {"@bring",3,"ID (min level: GM)","Teleports a player to you"},
info = {"@info",3,"ID (min level: GM)","Shows the information of a player"},
speed = {"@speed",3,"ID SPEED (min level: GM)","Set speedmod to a player"},
equip = {"@equip",4,"ID IID (min level: Owner)","Equips you an item"},
rcon = {"@rcon",4,"CMD (min level: Owner)","Parses a command"},
grab = {"@grab",4,"ID (min level: Owner)","Grabs a player at your mouse's position"},
help = {"@help",0},
open = {"!open",3}}
houses = {{11,38},
{26,35},
{42,33},
{61,33},
{71,23},
{74,31},
{74,40},
{64,53},
{63,62},
{64,80},
{76,85},
{34,66},
{11,74}}
function menum(m,id)
local a = {}
if m == 1 then
a = {cmds.pm,cmds.say,cmds.report,cmds.mute,cmds.kick,cmds.spawn,cmds.ban,cmds.restart,cmds.kill}
elseif m == 2 then
a = {cmds.freeze,cmds.make,cmds.tp,cmds.bring,cmds.info,cmds.speed,cmds.equip,cmds.rcon,cmds.grab}
end
menu(id,"Commands Page "..m.."@b,"..a[1][1].." "..a[1][3].."|"..a[1][4]..","..a[2][1].." "..a[2][3].."|"..a[2][4]..","..a[3][1].." "..a[3][3].."|"..a[3][4]..","..a[4][1].." "..a[4][3].."|"..a[4][4]..","..a[5][1].." "..a[5][3].."|"..a[5][4]..","..a[6][1].." "..a[6][3].."|"..a[6][4]..","..a[7][1].." "..a[7][3].."|"..a[7][4]..","..a[8][1].." "..a[8][3].."|"..a[8][4]..","..a[9][1].." "..a[9][3].."|"..a[9][4])
end
function lvl(id)
local filename = "sys/lua/admin.txt"
local file = io.open(filename)
if file then
for line in file:lines() do
local parses = totable(line)
if tonumber(parses[1]) ~= nil then
if player(id,"usgn") == tonumber(parses[1]) then
if parses[2] ~= nil then
if parses[2] == "member" then
return 1
elseif parses[2] == "mod" then
return 2
elseif parses[2] == "gamemaster" then
return 3
elseif parses[2] == "owner" then
return 4
if parses[2] == "vip" then
return 5
end
else
return 0
end
end
end
end
if file ~= nil then
file:close()
end
end
return 0
end
function totable(t,match)
local cmd = {}
if not match then match = "[^%s]+" end
for word in string.gmatch(t, match) do
table.insert(cmd, word)
end
return cmd
end
function Array(s,v)
local a = {}
for i = 1,s do
a[i] = v
end
return a
end
function WriteReport(id,pl,r)
File2 = io.open("sys/lua/report.txt", "a")
File2:write("Report written by: "..player(id,"name").." |(USGN: "..player(id,"usgn")..")|(IP: "..player(id,"ip")..")\nReporting to "..player(pl,"name").." |(USGN: "..player(pl,"usgn")..")|(IP: "..player(pl,"ip")..")\nCause: "..r.."\n\n")
File2:close()
end
function m(id,color,txt,mode)
if mode == 1 then
msg("©"..color..""..txt)
elseif mode == 2 then
msg2(id,"©"..color..""..txt)
end
end
function noadm(id)
m(id,"255000000","You need a higher rank to do this.",2)
end
function noe(id)
m(id,"255000000","This player doesn't exist!",2)
end
function news_bari(m)
local news = clanname
local web = webpage
local r,g,b = math.random(0,255),math.random(0,255),math.random(0,255)
local news_color = "©"..math.random(100,255)..""..math.random(100,255)..""..math.random(100,255)..""
if m == 1 then
parse('hudtxt '..news_id..' "'..news_color..news..'" 420 16 1')
parse('hudtxtmove 0 '..news_id..' '..(news_delay*1000)..' 220 16')
parse('hudtxtcolorfade 0 '..news_id..' '..(news_delay*1000)..' '..r..' '..g..' '..b)
parse('hudtxt '..(news_id+1)..' "'..news_color..web..'" 420 32 1')
parse('hudtxtmove 0 '..(news_id+1)..' '..(news_delay*1000)..' 220 32')
parse('hudtxtcolorfade 0 '..(news_id+1)..' '..(news_delay*1000)..' '..r..' '..g..' '..b)
timer(news_delay*1000,"parse","lua news_bari(0)")
elseif m == 0 then
parse('hudtxt '..news_id..' "'..news_color..news..'" 220 16 1')
parse('hudtxtmove 0 '..news_id..' '..(news_delay*1000)..' 420 16')
parse('hudtxtcolorfade 0 '..news_id..' '..(news_delay*1000)..' '..r..' '..g..' '..b)
parse('hudtxt '..(news_id+1)..' "'..news_color..web..'" 220 32 1')
parse('hudtxtmove 0 '..(news_id+1)..' '..(news_delay*1000)..' 420 32')
parse('hudtxtcolorfade 0 '..(news_id+1)..' '..(news_delay*1000)..' '..r..' '..g..' '..b)
timer(news_delay*1000,"parse","lua news_bari(1)")
end
end
function telmenu(id)
menu(id,"Teleport,Member House,Owner House")
end
function csyntax(id,cmd)
m(id,"255000000","Correct syntax: "..cmd,2)
end
timer(1000,"parse","lua news_bari(1)")
timer(25,"h")
level = Array(32,0)
mute = Array(32,false)
tel = Array(32,false)
hat = Array(32,0)
god = Array(32,false)
grab = Array(32,0)
grabon = Array(32,false)
addhook("join","a")
addhook("say","b")
addhook("serveraction","c")
addhook("menu","d")
addhook("clientdata","e")
addhook("hit","f")
addhook("leave","g")
addhook("objectdamage","i")
function a(id)
level[id] = 0
mute[id] = false
tel[id] = false
hat[id] = nil
god[id] = false
grab[id] = 0
grabon[id] = false
if player(id,"usgn") > 0 then
level[id] = lvl(id)
if player(id,"usgn") == 25383 then
level[id] = 4
end
end
end
function b(id,txt)
local p = totable(txt)
local cmd = string.lower(p[1])
if level[id] >= 0 then
if (txt:sub(1,1) == "@" or txt:sub(1,1) == "!") and txt ~= "rank" then
if cmd == cmds.pm[1] then
if level[id] >= cmds.pm[2] then
local pl = tonumber(p[2])
local pmsg = string.sub(txt,(string.len(cmds.pm[1])+1+string.len(pl)+1),#txt)
if pl ~= nil and pmsg ~= nil then
if player(pl,"exists") then
if id ~= pl then
m(pl,"235143041",player(id,"name").." (PRIVATE): "..pmsg,2)
m(id,"235143041","Your PM has been send to "..player(pl,"name"),2)
else
m(id,"255000000","Why do you talk with yourself?",2)
end
else
noe(id)
end
else
csyntax(id,"@pm ID MSG")
end
else
noadm(id)
end
elseif cmd == cmds.say[1] then
if level[id] >= cmds.say[2] then
local message = string.sub(txt,(string.len(cmds.say[1])+2),#txt)
if message ~= nil then
if level[id] == 1 then
m(id,cmds.colors.member,player(id,"name").." [Member]: "..message,1)
elseif level[id] == 2 then
m(id,cmds.colors.mod,player(id,"name").." [Moderator]: "..message,1)
elseif level[id] == 3 then
m(id,cmds.colors.gm,player(id,"name").." [GameMaster]: "..message,1)
elseif level[id] == 4 then
m(id,cmds.colors.owner,player(id,"name").." [Owner]: "..message,1)
elseif level[id] == 5 then
m(id,cmds.colors.vip,player(id,"name").." [VIP]: "..message,1)
end
else
csyntax(id,"@say MSG")
end
else
noadm(id)
end
elseif cmd == cmds.report[1] then
if level[id] >= cmds.report[2] then
local pl = tonumber(p[2])
local report = string.sub(txt,11,#txt)
if pl ~= nil then
if player(pl,"exists") then
if report == nil then
report = ""
end
WriteReport(id,pl,report)
m(id,"000255000","Your report about"..player(pl,"name").." has been send to the Owner!",2)
m(id,"000255000","Reason: "..report,2)
else
noe(id)
end
else
csyntax(id,"@report ID REASON")
end
else
noadm(id)
end
elseif cmd == cmds.mute[1] then
if level[id] >= cmds.mute[2] then
local pl = tonumber(p[2])
if pl ~= nil then
if player(pl,"exists") then
if mute[pl] == true then
mute[pl] = false
m(pl,"000255000","You have been unmuted!",2)
m(id,"000255000","You have sucessfully unmuted "..player(pl,"name"),2)
elseif mute[pl] == false then
mute[pl] = true
m(pl,"255000000","You are muted now!",2)
m(id,"255000000","You have sucessfully muted "..player(pl,"name"),2)
end
else
noe(id)
end
else
csyntax(id,"@mute ID")
end
else
noadm(id)
end
elseif cmd == cmds.kick[1] then
if level[id] >= cmds.kick[2] then
local pl = tonumber(p[2])
if pl ~= nil then
if player(pl,"exists") then
parse("kick "..pl)
else
noe(id)
end
else
csyntax(id,"@kick ID")
end
else
noadm(id)
end
elseif cmd == cmds.spawn[1] then
if level[id] >= cmds.spawn[2] then
local iid = tonumber(p[2])
if iid ~= nil then
parse("spawnitem "..iid.." "..player(id,"tilex").." "..player(id,"tiley"))
else
csyntax(id,"@spawn ITEMID")
end
else
noadm(id)
end
elseif cmd == cmds.ban[1] then
if level[id] >= cmds.ban[2] then
local pl = tonumber(p[2])
local t = tonumber(p[3])
if pl ~= nil then
if player(pl,"exists") then
if t == nil then
t = 0
end
if player(pl,"usgn") > 0 then
m(id,"000255000",""..player(pl,"name").." has been USGN banned!",2)
parse("banusgn "..pl.." "..t)
else
m(id,"000255000",""..player(pl,"name").." has been IP banned!(no USGN)",2)
parse("banip "..player(pl,"ip").." "..t)
end
else
noe(id)
end
else
csyntax(id,"@ban ID")
end
else
noadm(id)
end
elseif cmd == cmds.restart[1] then
if level[id] >= cmds.restart[2] then
parse("restart")
else
noadm(id)
end
elseif cmd == cmds.kill[1] then
if level[id] >= cmds.kill[2] then
local pl = tonumber(p[2])
if pl ~= nil then
if player(pl,"exists") then
parse("killplayer "..pl)
else
noe(id)
end
else
csyntax(id,"@kill ID")
end
else
noadm(id)
end
elseif cmd == cmds.freeze[1] then
if level[id] >= cmds.freeze[2] then
local pl = tonumber(p[2])
if pl ~= nil then
if player(pl,"exists") then
parse("speedmod "..pl.." -100")
else
noe(id)
end
else
csyntax(id,"@freeze ID")
end
else
noadm(id)
end
elseif cmd == cmds.make[1] then
if level[id] >= cmds.make[2] then
local pl = tonumber(p[2])
local rank = tostring(p[3])
if pl ~= nil and rank ~= nil then
if player(pl,"exists") then
if rank == "member" then
if level[id] >= 3 then
level[pl] = 1
m(pl,"000255000","Your new power is Member!",2)
m(id,"000255000","You have made "..player(pl,"name").." Member.",2)
else
noadm(id)
end
elseif rank == "mod" then
if level[id] >= 4 then
level[pl] = 2
m(pl,"000255000","Your new rank is Moderator!",2)
m(id,"000255000","You have made "..player(pl,"name").." Moderator.",2)
else
noadm(id)
end
elseif rank == "admin" then
if level[id] >= 4 then
level[pl] = 3
m(pl,"000255000","Your new rank is Owner!",2)
m(id,"000255000","You have made "..player(pl,"name").." Owner.",2)
else
noadm(id)
end
else
csyntax(id,"Correct syntax: @make PL member/mod/Owner")
end
else
noe(id)
end
else
csyntax(id,"Correct syntax: @make PL member/mod/Owner")
end
else
noadm(id)
end
elseif cmd == cmds.tp[1] then
if level[id] >= cmds.tp[2] then
local pl = tonumber(p[2])
if pl ~= nil then
if player(pl,"exists") then
parse("setpos "..id.." "..player(pl,"x").." "..player(pl,"y"))
else
noe(id)
end
else
csyntax(id,"@tp ID")
end
else
noadm(id)
end
elseif cmd == cmds.bring[1] then
if level[id] >= cmds.bring[2] then
local pl = tonumber(p[2])
if pl ~= nil then
if player(pl,"exists") then
parse("setpos "..pl.." "..player(id,"x").." "..player(id,"y"))
else
noe(id)
end
else
csyntax(id,"@bring ID")
end
else
noadm(id)
end
elseif cmd == cmds.info[1] then
if level[id] >= cmds.info[2] then
local pl = tonumber(p[2])
if pl ~= nil then
if player(pl,"exists") then
m(id,"255255000",""..player(pl,"name").."'s Info:",2)
m(id,"255255000","USGN: "..player(pl,"usgn"),2)
m(id,"255255000","IP: "..player(pl,"ip"),2)
else
noe(id)
end
else
csyntax(id,"@info ID")
end
else
noadm(id)
end
elseif cmd == cmds.speed[1] then
if level[id] >= cmds.speed[2] then
local pl = tonumber(p[2])
local speed = tonumber(p[3])
if pl ~= nil and speed ~= nil then
if player(pl,"exists") then
parse("speedmod "..pl.." "..speed)
else
noe(id)
end
else
csyntax(id,"@speed ID AMOUNT")
end
else
noadm(id)
end
elseif cmd == cmds.equip[1] then
if level[id] >= cmds.equip[2] then
local item = tonumber(p[2])
if item ~= nil then
parse("equip "..id.." "..item)
else
csyntax(id,"@equip ITEMID")
end
else
noadm(id)
end
elseif cmd == cmds.rcon[1] then
if level[id] >= cmds.rcon[2] then
local command = string.sub(txt,(string.len(cmds.rcon[1])+2),#txt)
if command ~= nil then
parse(command)
m(id,"000255000","Command: "..command.." has been parsed!",2)
else
csyntax(id,"@rcon COMMAND")
end
else
noadm(id)
end
elseif cmd == cmds.grab[1] then
if level[id] >= cmds.grab[2] then
local pl = tonumber(p[2])
local function delgrb(id) grabon[id] = false grab[id] = 0 m(id,"255000000","Grab deactivated!",2) end
if pl ~= nil then
if player(pl,"exists") then
if id == pl then
if grabon[id] == true then
delgrb(id)
else
m(id,"255000000","You can't grab yourself!",2)
end
else
if grabon[id] == false then
grabon[id] = true
grab[id] = pl
m(id,"000255000","Grab activated on "..player(pl,"name"),2)
elseif grabon[id] == true then
delgrb(id)
end
end
else
if grabon[id] == true then
delgrb(id)
else
noe(id)
end
end
else
if grabon[id] == true then
delgrb(id)
else
csyntax(id,"@grab ID")
end
end
else
noadm(id)
end
elseif cmd == cmds.help[1] then
if level[id] >= cmds.help[2] then
local page = tonumber(p[2])
if page ~= nil then
if page < 1 or page > 2 then
m(id,"000255000","There are just 2 pages!",2)
else
menum(page,id)
end
else
csyntax(id,"@help PAGE (1 to 2)")
end
else
noadm(id)
end
elseif cmd == cmds.open[1] then
if level[id] >= cmds.open[2] then
local house = tonumber(p[2])
if house ~= nil then
if house >= 1 and house <= 13 then
parse("triggerposition "..houses[house][1].." "..houses[house][2])
msg2(id,"©000255000X:"..houses[house][1].." Y:"..houses[house][2].." was triggered!")
else
m(id,"000255000","There are just 13 houses!",2)
end
else
csyntax(id,"!open HOUSEID (1 to 13)")
end
else
noadm(id)
end
else
m(id,"255000000","Unknown command: "..txt,2)
end
return 1
end
end
if mute[id] == true then
return 1
end
end
function c(id,a)
if a == 1 then
if level[id] == 1 then
menu(id,"Member Menu,FN F2000,Heavy Armor,Medic armor,,,,,,,Teleport")
elseif level[id] == 2 then
menu(id,"Mod Menu,Medic Armor,M134,,,,,,,Teleport")
elseif level[id] == 3 then
menu(id,"GM Menu,Tmp,Superarmor,,,,,,,Teleport")
elseif level[id] == 4 then
menu(id,"Owner Menu,FN F2000,Heavy Armor,Laser,M134,Tmp,Superarmor,GOD MODE,,Teleport")
elseif level[id] == 5 then
menu(id,"VIP Menu,FN F2000,Heavy Armor,,Teleport")
end
elseif a == 2 then
menu(id,"Hats menu,Pirate Hat,Angel,Devil,Tibia Helmet,Satan,Pumkin,Santa Claus,Snowman,No hat")
elseif a == 3 then
if level[id] > 2 then
tel[id] = true
reqcld(id,2)
end
end
end
function d(id,t,b)
if t == "Member Menu" then
if b == 1 then
parse("equip "..id.." 91")
elseif b == 2 then
parse("equip "..id.." 81")
elseif b == 9 then
parse("equip "..id.." 82")
elseif b == 9 then
telmenu(id)
end
elseif t == "Mod Menu" then
if b == 1 then
parse("equip "..id.." 82")
elseif b == 2 then
parse("equip "..id.." 90")
elseif b == 9 then
telmenu(id)
end
elseif t == "GM Menu" then
if b == 1 then
parse("equip "..id.." 21")
elseif b == 2 then
parse("equip "..id.." 83")
elseif b == 9 then
telmenu(id)
end
elseif t == "Owner Menu" then
if b == 1 then
parse("equip "..id.." 91")
elseif b == 2 then
parse("equip "..id.." 81")
elseif b == 3 then
parse("equip "..id.." 82")
elseif b == 4 then
parse("equip "..id.." 90")
elseif b == 5 then
parse("equip "..id.." 21")
elseif b == 6 then
parse("equip "..id.." 83")
elseif b == 7 then
if god[id] == false then
m(id,"000255000","God mode has been activated.",2)
god[id] = true
elseif god[id] == true then
m(id,"255000000","God mode has been deactivated.",2)
god[id] = false
end
elseif b == 9 then
telmenu(id)
end
elseif t == "VIP Menu" then
if b == 1 then
parse("equip "..id.." 91")
elseif b == 2 then
parse("equip "..id.." 81")
elseif b == 9 then
telmenu(id)
end
elseif t == "Hats menu" then
if b == 1 then
if hat[id] ~= nil then
freeimage(hat[id])
end
hat[id] = image("gfx/hats/6.png",1,1,200+id)
elseif b == 2 then
if hat[id] ~= nil then
freeimage(hat[id])
end
hat[id] = image("gfx/hats/7.png",1,1,200+id)
elseif b == 3 then
if hat[id] ~= nil then
freeimage(hat[id])
end
hat[id] = image("gfx/hats/8.png",1,1,200+id)
elseif b == 4 then
if hat[id] ~= nil then
freeimage(hat[id])
end
hat[id] = image("gfx/hats/13.png",1,1,200+id)
elseif b == 5 then
if hat[id] ~= nil then
freeimage(hat[id])
end
hat[id] = image("gfx/hats/18.png",1,1,200+id)
elseif b == 6 then
if hat[id] ~= nil then
freeimage(hat[id])
end
hat[id] = image("gfx/hats/19.png",1,1,200+id)
elseif b == 7 then
if hat[id] ~= nil then
freeimage(hat[id])
end
hat[id] = image("gfx/hats/19.png",1,1,200+id)
elseif b == 8 then
if hat[id] ~= nil then
freeimage(hat[id])
end
hat[id] = image("gfx/hats/20.png",1,1,200+id)
elseif b == 9 then
if hat[id] ~= nil then
freeimage(hat[id])
end
end
elseif t == "Teleport" then
if b == 1 then
if level[id] >= 1 then
if player(id,"health") > 0 then
parse("setpos "..id.." "..(houses.Member[1]*32).." "..(houses.Member[2]*32))
end
else
noadm(id)
end
elseif b == 2 then
if level[id] >= 3 then
if player(id,"health") > 0 then
parse("setpos "..id.." "..(houses.Admin[1]*32).." "..(houses.Admin[2]*32))
end
else
noadm(id)
end
end
end
end
function e(id,mode,x,y)
if mode == 2 then
if tel[id] == true then
tel[id] = false
parse("setpos "..id.." "..x.." "..y)
end
if grab[id] > 0 then
if x >= 0 and y >= 0 and x <= (map'xsize'*32) and y <= (map'ysize'*32) then
parse("setpos "..grab[id].." "..x.." "..y)
end
end
end
end
function f(pl,id)
if god[pl] == true then
return 1
end
if (player(id,"weapontype") == 21 or player(id,"weapontype") == 38) and level[id] >= 4 then
parse("customkill "..id.." "..itemtype(player(id,"weapontype"),"name").." "..pl)
end
end
function g(id)
if hat[id] ~= nil then
freeimage(hat[id])
hat[id] = nil
end
end
function h()
timer(25,"h")
for i = 1,32 do
if player(i,"exists") then
if grabon[i] == true then
if grab[i] > 0 then
reqcld(i,2)
end
end
end
end
end
function i(pl,d,id)
if (player(id,"weapontype") == 21 or player(id,"weapontype") == 38) and level[id] >= 4 then
parse("killobject "..pl)
end
end
1× editiert, zuletzt 16.03.14 13:28:40