1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
admin_table = {DEINE USGN ID HIER!}
mod_table = {}
path = "/home/cs2dsrv/globalban.txt"
statusmax = 2
-- playerstats[ID][1] = Admin (Ja/Nein)
-- playerstats[ID][2] = Mod (Ja/Nein)
playerstats={}
for a = 1, 32 do
playerstats[a] = {}
for i = 1, statusmax do
playerstats[a][i] = 0
end
end
function intable(tbl, v)
for i, va in pairs(tbl) do
if va == v then
return true
end
end
return false
end
addhook("join","joinadmin")
function joinadmin(id)
if intable(admin_table, player(id, "usgn")) then
playerstats[id][1] = 1
elseif intable(mod_table, player(id, "usgn")) then
playerstats[id][2] = 1
end
msg2(id, "Welcome to our Server, " .. player(id, "name") .. "!@C")
end
addhook("leave","leaveadmin")
function leaveadmin(id)
playerstats[id][1] = 0
playerstats[id][2] = 0
end
addhook ("say", "sages")
function sages(id,txt)
if playerstats[id][1] == 1 or playerstats[id][2] then
if txt:sub(1, 2) == "!!" then
msg("©255255255" .. txt:sub(3) .. "@C")
return 1
elseif txt:sub(1, 4) == "!ban" and playerstats[id][1] then
local banid = tonumber(txt:sub(5))
if player(banid,"usgn") ~= 0 then
parse("banusgn " .. player(banid, "usgn"))
end
parse("banip " .. player(banid, "ip"))
local file = io.open(path, "a")
if player(banid, "usgn") ~= 0 then
file:write("banusgn ", player(banid, "usgn"), "\n")
end
file:write("banip ", player(banid, "ip"), "\n")
file:close()
return 1
elseif txt:sub(1, 5) == "!kick" then
parse("kick " .. txt:sub(6))
return 1
elseif txt:sub(1, 5) == "!slap" then
parse("slap " .. txt:sub(6))
return 1
elseif txt:sub(1, 6) == "!dslap" then
parse("deathslap " .. txt:sub(7))
return 1
elseif txt:sub(1, 1) == "!" and playerstats[id][1] then
msg("©255255255" .. player(id, "name") .. " (Member): " .. txt:sub(2))
return 1
elseif txt:sub(1, 1) == "!" and playerstats[id][2] then
msg("©255255255" .. player(id, "name") .. " (Mod): " .. txt:sub(2))
return 1
end
end
end
addhook("name", "namechange")
function namechange(id, oldname, newname)
if string.sub(newname, 1, 7):lower() == "[kebab]" then
if not playerstats[id][1] == 1 then
return 1
end
end
end
addhook("minute", "werbung")
function werbung()
msg("©255255255Visit us at www.Kebab-Clan.de")
parse("unbanall")
parse("exec " .. path)
end