I was making my script and i had some errors and i'm lazy for checking it , so i said maybe some one will help me .
The Code
Admins = {120840,64650,35065,112265} -- Every USGN ID is admin . --rodion = {64650} pirates = {120840} nova = {35065} tricky = {112265} hitman = {120792} paprika = {121205} mora = {114940} x = {48396} dragon = {108309}
Mods = {120792,121205,114940,48396,108309} -- Every USGN ID is mod .
VIPs = {} --Every USGN ID is vip .
Player = {} --DON'T TOUCH THIS !!
teleportMode = {} --DON'T TOUCH THIS !!
function initArray(m,v)
if not v then v = 0 end
local array = {}
for i = 1, m do
array[i]=v
end
return array
end
table_pick_itens = {64,65,66,67,68}
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:lower())
end
return cmd
end
class = initArray(32)
flood = initArray(32)
timer = initArray(32)
no_mute = initArray(32)
muted=initArray(32,false)
local timer_mute = 60
hats = true
addhook("say","_say")
addhook("serveraction","_serveraction")
addhook("menu","_menu")
addhook("die","_die")
addhook("second","_second")
addhook("leave","_leave")
addhook("join","_join")
addhook("join","adsjoin")
addhook("minute","adsminute")
addhook("clientdata","_clientdata")
addhook("spawn","rspawn")
_say = function (id,txt)
local p = totable(txt)
local cmd = tostring(p[1])
local pl = tonumber(p[2])
if cmd == "!usgn" then
msg2(id,"\169050255050USGN : "..player(id,"usgn").." ")
msg2(id,"\169050255050IP : "..player(id,"ip").." ")
msg2(id,"\169050255050Ping : "..player(id,"ping").." ")
return 1
elseif cmd == "!help" then
msg2(id,"\169255255255-=Help=-")
msg2(id,"\169255255255Script made by P!r@te$ k!ller , USGN : 120840")
msg2(id,"\169255255255Have fun .")
return 1
elseif cmd == "!resetscore" then
parse ("setscore "..id.." 0")
parse ("setdeaths "..id.." 0")
msg("\169050050255Script : Player "..player(id,"name").." has reset his score .")
return 1
elseif cmd == "!rs" then
parse ("setscore "..id.." 0")
parse ("setdeaths "..id.." 0")
msg("\169050050255Script : Player "..player(id,"name").." has reset his score .")
return 1
elseif cmd == "!cmds" then
msg2(id,"\169255255255-=Cmds=-")
msg2(id,"\169255255255!usgn : To see your usgn , ip and ping .")
msg2(id,"\169255255255!help : Just small help ..")
msg2(id,"\169255255255!cmds : To see the cmds .")
msg2(id,"\169255255255!rs : To reset your score .")
msg2(id,"\169255255255!resetscore : To reset your score .")
return 1
end
if flood[id] == 8 then
msg2(id,"\169255000000Script : Stop Spam ! @C")
end
if flood[id] == 15 then
parse("kick "..id.." \" Auto-kicked because of spamming ! \" ")
end
if muted[id] == true then
msg2(id,"\169255255255You are muted, for "..timer_mute.." Seconds")
timer[id] = 5
return 1
end
local r = Player[id].r / 100 * Player[id].v
local g = Player[id].g / 100 * Player[id].v
local b = Player[id].b / 100 * Player[id].v
r = math.floor(r)
g = math.floor(g)
b = math.floor(b)
if r < 10 then
r = "00"..r
elseif r < 100 then
r = "0"..r
end
if g < 10 then
g = "00"..g
elseif g < 100 then
g = "0"..g
end
if b < 10 then
b = "00"..b
elseif b < 100 then
b = "0"..b
end
msg("\169"..r..""..g..""..b..""..player(id,"name")..": "..txt)
flood[id] = flood[id] +1
timer[id] = 5
return 1
end
_serveraction = function (id,action)
if action == 1 then
for _, usgn in ipairs(Admins) do
if player(id,'usgn') == usgn then
menu_admin(id)
return 1
end
end
for _, usgn in ipairs(Mods) do
if player(id,'usgn') == usgn then
menu_mod(id)
return 1
end
end
for _, usgn in ipairs(VIPs) do
if player(id,'usgn') == usgn then
menu_vip(id)
return 1
end
end
end
end
_menu = function (id,title,buton)
if title == "Admin Menu" then
if buton == 1 then
menu_hats(id)
end
if buton == 2 then
menu_color(id)
end
if buton == 3 then
menu_players(id)
end
if buton == 4 then
menu_settings(id)
end
if b==5 and teleportMode[id]==0 then
msg2(id,"©000255111Specail spawn | On")
teleportMode[id]=1
elseif b==5 and teleportMode[id]==1 then
msg2(id,"©000255111Specail spawn | Off")
teleportMode[id]=0
end
end
if title == "Mod Menu" then
if buton == 1 then
menu_hats(id)
end
if buton == 2 then
menu_color(id)
end
if buton == 3 then
menu_players(id)
end
if b==4 and teleportMode[id]==0 then
msg2(id,"©000255111Specail spawn | On")
teleportMode[id]=1
elseif b==4 and teleportMode[id]==1 then
msg2(id,"©000255111Specail spawn | Off")
teleportMode[id]=0
end
end
if title == "VIP Menu" then
if buton == 1 then
menu_hats(id)
end
if buton == 2 then
menu_color(id)
end
end
if title == "Server Settings" then
if buton == 1 then
parse("restart")
end
if buton == 2 then
menu_infammo(id)
end
end
if title == "Infinity Ammo" then
if buton == 1 then
parse("mp_infammo 1")
end
if buton == 2 then
parse("mp_infammo 2")
end
end
if title=="Players Menu" then
if buton==1 then
menu(id,"Kick Page 1,"..existk(1).."|1,"..existk(2).."|2,"..existk(3).."|3,"..existk(4).."|4,"..existk(5).."|5,"..existk(6).."|6,"..existk(7).."|7,"..existk(8).."|8,Next")
elseif buton==2 then
menu(id,"Ban Page 1,"..existb(1).."|1,"..existb(2).."|2,"..existb(3).."|3,"..existb(4).."|4,"..existb(5).."|5,"..existb(6).."|6,"..existb(7).."|7,"..existb(8).."|8,Next")
elseif buton==3 then
menu(id,"Slap Page 1,"..existslap(1).."|1,"..existslap(2).."|2,"..existslap(3).."|3,"..existslap(4).."|4,"..existslap(5).."|5,"..existslap(6).."|6,"..existslap(7).."|7,"..existslap(8).."|8,Next")
end
--- KICK ---
elseif title=="Kick Page 1" then
if buton==9 then
menu(id,"Kick Page 2,"..existk(9).."|9,"..existk(10).."|10,"..existk(11).."|11,"..existk(12).."|12,"..existk(13).."|13,"..existk(14).."|14,"..existk(15).."|15,"..existk(16).."|16,Next")
elseif buton~=0 then
ki(buton)
end
elseif title=="Kick Page 2" then
if buton==9 then
menu(id,"Kick Page 3,"..existk(17).."|17,"..existk(18).."|18,"..existk(19).."|19,"..existk(20).."|20,"..existk(21).."|21,"..existk(22).."|22,"..existk(23).."|23,"..existk(24).."|24,Next")
elseif buton~=0 then
ki(buton+8)
end
elseif title=="Kick Page 3" then
if buton==9 then
menu(id,"Kick Page 4,"..existk(25).."|25,"..existk(26).."|26,"..existk(27).."|27,"..existk(28).."|28,"..existk(29).."|29,"..existk(30).."|30,"..existk(31).."|31,"..existk(32).."|32,Back")
elseif buton~=0 then
ki(buton+16)
end
elseif title=="Kick Page 4" then
if buton~=0 then
ki(buton+24)
end
--- BAN ---
elseif title=="Ban Page 1" then
if buton==9 then
menu(id,"Ban Page 2,"..existb(9).."|9,"..existb(10).."|10,"..existb(11).."|11,"..existb(12).."|12,"..existb(13).."|13,"..existb(14).."|14,"..existb(15).."|15,"..existb(16).."|16,Next")
elseif buton~=0 then
bi(buton)
end
elseif title=="Ban Page 2" then
if buton==9 then
menu(id,"Ban Page 3,"..existb(17).."|17,"..existb(18).."|18,"..existb(19).."|19,"..existb(20).."|20,"..existb(21).."|21,"..existb(22).."|22,"..existb(23).."|23,"..existb(24).."|24,Next")
elseif buton~=0 then
bi(buton+8)
end
elseif title=="Ban Page 3" then
if buton==9 then
menu(id,"Ban Page 4,"..existb(25).."|25,"..existb(26).."|26,"..existb(27).."|27,"..existb(28).."|28,"..existb(29).."|29,"..existb(30).."|30,"..existb(31).."|31,"..existb(32).."|32,Back")
elseif buton~=0 then
bi(buton+16)
end
elseif title=="Ban Page 4" then
if buton~=0 then
bi(buton+24)
end
--- SLAP ---
elseif title=="Slap Page 1" then
if buton==9 then
menu(id,"Slap Page 2,"..existslap(9).."|9,"..existslap(10).."|10,"..existslap(11).."|11,"..existslap(12).."|12,"..existslap(13).."|13,"..existslap(14).."|14,"..existslap(15).."|15,"..existslap(16).."|16,Next")
elseif buton~=0 then
si(buton)
end
elseif title=="Slap Page 2" then
if buton==9 then
menu(id,"Slap Page 3,"..existslap(17).."|17,"..existslap(18).."|18,"..existslap(19).."|19,"..existslap(20).."|20,"..existslap(21).."|21,"..existslap(22).."|22,"..existslap(23).."|23,"..existslap(24).."|24,Next")
elseif buton~=0 then
si(buton+8)
end
elseif title=="Slap Page 3" then
if buton==9 then
menu(id,"Slap Page 4,"..existslap(25).."|25,"..existslap(26).."|26,"..existslap(27).."|27,"..existslap(28).."|28,"..existslap(29).."|29,"..existslap(30).."|30,"..existslap(31).."|31,"..existslap(32).."|32,Back")
elseif buton~=0 then
si(buton+16)
end
elseif title=="Slap Page 4" then
if buton~=0 then
si(buton+24)
end
end
if title == "Hats Menu" then
if buton == 1 then
freeimage(id)
cap_1 = image("gfx/cap.png",1,0,200+id)
imagecolor(cap_1,255,0,0)
elseif buton == 2 then
freeimage(id)
cap_2 = image("gfx/cap.png",1,0,200+id)
imagecolor(cap_2,0,255,0)
elseif buton == 3 then
freeimage(id)
cap_3 = image("gfx/cap.png",1,0,200+id)
imagecolor(cap_3,0,0,255)
elseif buton == 4 then
freeimage(id)
cap_4 = image("gfx/cap.png",1,0,200+id)
imagecolor(cap_4,255,255,0)
elseif buton == 5 then
freeimage(id)
cap_5 = image("gfx/cap.png",1,0,200+id)
imagecolor(cap_5,0,255,255)
elseif buton == 6 then
freeimage(id)
cap_6 = image("gfx/cap.png",1,0,200+id)
imagecolor(cap_6,255,0,255)
elseif buton == 7 then
freeimage(id)
cap_7 = image("gfx/cap.png",1,0,200+id)
imagecolor(cap_7,0,0,0)
elseif buton == 8 then
freeimage(id)
cap_8 = image("gfx/cap.png",1,0,200+id)
imagecolor(cap_8,255,255,255)
elseif buton == 9 then
freeimage(id)
end
end
end
function _die(id)
if Player[id].menu1 == 1 then
freeimage(Player[id].menu1i1)
freeimage(Player[id].menu1i2)
freeimage(Player[id].menu1i3)
freeimage(Player[id].menu1i4)
freeimage(Player[id].menu1i5)
freeimage(Player[id].menu1i6)
Player[id].menu1i1 = nil
Player[id].menu1i2 = nil
Player[id].menu1i3 = nil
Player[id].menu1i4 = nil
Player[id].menu1i5 = nil
Player[id].menu1i6 = nil
Player[id].menu1 = 0
parse('hudtxt2 '..id..' 40 "" 370 165')
parse('hudtxt2 '..id..' 41 "" 255 156')
parse('hudtxt2 '..id..' 42 "" 255 171')
parse('hudtxt2 '..id..' 43 "" 255 186')
end
end
_second = function (id)
for id = 1,32 do
if timer[id] > 0 then
timer[id] = timer[id] -1
else
flood[id] = 0
end
end
for _,id in pairs(player(0,"table")) do
if muted[id] == true then
no_mute[id] = no_mute[id]-1
end
if no_mute[id] == 0 then
muted[id] = false
end
end
parse ("sv_gamemode 1")
parse ('mp_building_limit "barricade" 300')
parse ('mp_building_limit "wall I" 80')
parse ('mp_building_limit "wall II" 120')
parse ('mp_building_limit "wall III" 100')
parse ('mp_building_limit "gate field" 30')
parse ('mp_building_limit "turret" 2')
parse ('mp_building_limit "dispenser" 3')
parse ('mp_building_limit "supply" 2')
parse ('mp_building_limit "Teleporter Entrance" 2')
parse ('mp_building_limit "Teleporter Exit" 2')
end
_leave = function (id)
muted[id] = false
teleportMode[id] = 0
end
_join = function (id)
teleportMode[id] = 0
flood[id] = 0
muted[id] = false
Player[id] = {}
Player[id].menu1 = 0
Player[id].r = 100
Player[id].g = 100
Player[id].b = 100
Player[id].v = 100
end
menu_hats = function (id)
menu (id,"Hats Menu,Cap Red,Cap Green,Cap Blue,Cap Yellow,Cap Cyan,Cap Pink,Cap Black,Cap White,None Cap")
end
menu_admin = function (id)
menu(id,"Admin Menu,Hats Menu,Color Menu,Players Menu,Server Settings,Specail Spawn")
end
menu_mod = function (id)
menu(id,"Mod Menu,Hats Menu,Color Menu,Players Menu,Specail Spawn")
end
menu_vip = function (id)
menu(id,"VIP Menu,Hats Menu,Color Menu")
end
menu_color = function(id)
if Player[id].menu1 == 0 then
Player[id].menu1i1 = image("gfx/yates/lua/shit_colour_menu.png",320,240,2,id)
Player[id].menu1i2 = image("gfx/yates/lua/shit_colour_menu_example.png",320,240,2,id)
Player[id].menu1i3 = image("gfx/yates/lua/shit_colour_menu_arrow.png",192+Player[id].r,230,2,id)
Player[id].menu1i4 = image("gfx/yates/lua/shit_colour_menu_arrow.png",192+Player[id].g,258,2,id)
Player[id].menu1i5 = image("gfx/yates/lua/shit_colour_menu_arrow.png",192+Player[id].b,286,2,id)
Player[id].menu1i6 = image("gfx/yates/lua/shit_colour_menu_arrow.png",338+Player[id].v,198,2,id)
Player[id].menu1 = 1
_updateshitcolourexample(id)
else
freeimage(Player[id].menu1i1)
freeimage(Player[id].menu1i2)
freeimage(Player[id].menu1i3)
freeimage(Player[id].menu1i4)
freeimage(Player[id].menu1i5)
freeimage(Player[id].menu1i6)
Player[id].menu1i1 = nil
Player[id].menu1i2 = nil
Player[id].menu1i3 = nil
Player[id].menu1i4 = nil
Player[id].menu1i5 = nil
Player[id].menu1i6 = nil
Player[id].menu1 = 0
parse('hudtxt2 '..id..' 40 "" 370 165')
parse('hudtxt2 '..id..' 41 "" 255 156')
parse('hudtxt2 '..id..' 42 "" 255 171')
parse('hudtxt2 '..id..' 43 "" 255 186')
end
end
menu_players = function (id)
menu(id,"Players Menu,Kick,Ban,Slap")
end
menu_settings = function (id)
menu(id,"Server Settings,Restart,Infinity Ammo")
end
menu_infammo = function (id)
menu(id,"Infinity Ammo,ON,OFF")
end
function adsjoin(id)
msg2(id,"©30 144255 Welcome on "..game("sv_name").." Server, "..player(id,"name").."!")
end
function adsminute()
msg("©30 144255 Do you want help ? , !cmds .")
end
function ki(pl)
parse("kick "..pl.." \" (kicked) \" ")
end
function bi(pl)
parse("banip "..pl.." \" (banned by ip) \" ")
end
function si(pl)
parse("slap "..pl.."")
end
function existk(param)
if player(param,"exists") then
return player(param,"name")
else
return ""
end
end
function existb(param)
if player(param,"exists") then
return player(param,"name")
else
return ""
end
end
function existslap(param)
if player(param,"exists") then
return player(param,"name")
else
return ""
end
end
function _clientdata(id,mode,data1,data2)
if mode == 0 then
if Player[id].menu1 == 1 then
-- R
if data1 >= 192 and data1 <= 447 and data2 >= 217 and data2 <= 232 then
Player[id].r = (data1 - 192)
end
-- G
if data1 >= 192 and data1 <= 447 and data2 >= 245 and data2 <= 260 then
Player[id].g = (data1 - 192)
end
-- B
if data1 >= 192 and data1 <= 447 and data2 >= 273 and data2 <= 288 then
Player[id].b = (data1 - 192)
end
-- V
if data1 >= 338 and data1 <= 438 and data2 >= 185 and data2 <= 200 then
Player[id].v = (data1 - 338)
end
if data1 >= 200 and data1 <= 440 and data2 >= 305 and data2 <= 330 then
freeimage(Player[id].menu1i1)
freeimage(Player[id].menu1i2)
freeimage(Player[id].menu1i3)
freeimage(Player[id].menu1i4)
freeimage(Player[id].menu1i5)
freeimage(Player[id].menu1i6)
Player[id].menu1i1 = nil
Player[id].menu1i2 = nil
Player[id].menu1i3 = nil
Player[id].menu1i4 = nil
Player[id].menu1i5 = nil
Player[id].menu1i6 = nil
Player[id].menu1 = 0
parse('hudtxt2 '..id..' 40 "" 370 165')
parse('hudtxt2 '..id..' 41 "" 255 156')
parse('hudtxt2 '..id..' 42 "" 255 171')
parse('hudtxt2 '..id..' 43 "" 255 186')
end
_updateshitcolourexample(id)
end
end
end
function _endround()
for _,id in pairs(player(0,"table")) do
if Player[id].menu1 == 1 then
freeimage(Player[id].menu1i1)
freeimage(Player[id].menu1i2)
freeimage(Player[id].menu1i3)
freeimage(Player[id].menu1i4)
freeimage(Player[id].menu1i5)
freeimage(Player[id].menu1i6)
Player[id].menu1i1 = nil
Player[id].menu1i2 = nil
Player[id].menu1i3 = nil
Player[id].menu1i4 = nil
Player[id].menu1i5 = nil
Player[id].menu1i6 = nil
Player[id].menu1 = 0
parse('hudtxt2 '..id..' 40 "" 370 165')
parse('hudtxt2 '..id..' 41 "" 255 156')
parse('hudtxt2 '..id..' 42 "" 255 171')
parse('hudtxt2 '..id..' 43 "" 255 186')
end
end
end
function _updateshitcolourexample(id)
local r = Player[id].r / 100 * Player[id].v
local g = Player[id].g / 100 * Player[id].v
local b = Player[id].b / 100 * Player[id].v
imagecolor(Player[id].menu1i2,r,g,b)
imagepos(Player[id].menu1i3,192+Player[id].r,230,0)
imagepos(Player[id].menu1i4,192+Player[id].g,258,0)
imagepos(Player[id].menu1i5,192+Player[id].b,286,0)
imagepos(Player[id].menu1i6,338+Player[id].v,198,2,id)
parse('hudtxt2 '..id..' 40 "\169255255255V:\169255255255 '..Player[id].v..'" 370 165')
parse('hudtxt2 '..id..' 41 "\169255000000R:\169255255255 '..Player[id].r..'" 255 156')
parse('hudtxt2 '..id..' 42 "\169000255000G:\169255255255 '..Player[id].g..'" 255 171')
parse('hudtxt2 '..id..' 43 "\169000000255B:\169255255255 '..Player[id].b..'" 255 186')
end
function rspawn(id)
for _, usgn in ipairs(rodion) do
if player(id,'usgn') == usgn and teleportMode[id]==1 then
parse("setpos "..id.." 1024 32")
end
for _, usgn in ipairs(tricky) do
if player(id,'usgn') == usgn and teleportMode[id]==1 then
parse("setpos "..id.." 1024 32")
end
for _, usgn in ipairs(nova) do
if player(id,'usgn') == usgn and teleportMode[id]==1 then
parse("setpos "..id.." 1024 32")
end
for _, usgn in ipairs(pirates) do
if player(id,'usgn') == usgn and teleportMode[id]==1 then
parse("setpos "..id.." 6608 2640")
end
for _, usgn in ipairs(hitman) do
if player(id,'usgn') == usgn and teleportMode[id]==1 then
parse("setpos "..id.." 6352 2032")
end
for _, usgn in ipairs(paprika) do
if player(id,'usgn') == usgn and teleportMode[id]==1 then
parse("setpos "..id.." 1024 32")
end
for _, usgn in ipairs(mora) do
if player(id,'usgn') == usgn and teleportMode[id]==1 then
parse("setpos "..id.." 6608 3248")
end
for _, usgn in ipairs(x) do
if player(id,'usgn') == usgn and teleportMode[id]==1 then
parse("setpos "..id.." 1024 32")
end
for _, usgn in ipairs(dragon) do
if player(id,'usgn') == usgn and teleportMode[id]==1 then
parse("setpos "..id.." 1024 32")
end
end
end
end
end
end
end
end
end
end
end
Mods = {120792,121205,114940,48396,108309} -- Every USGN ID is mod .
VIPs = {} --Every USGN ID is vip .
Player = {} --DON'T TOUCH THIS !!
teleportMode = {} --DON'T TOUCH THIS !!
function initArray(m,v)
if not v then v = 0 end
local array = {}
for i = 1, m do
array[i]=v
end
return array
end
table_pick_itens = {64,65,66,67,68}
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:lower())
end
return cmd
end
class = initArray(32)
flood = initArray(32)
timer = initArray(32)
no_mute = initArray(32)
muted=initArray(32,false)
local timer_mute = 60
hats = true
addhook("say","_say")
addhook("serveraction","_serveraction")
addhook("menu","_menu")
addhook("die","_die")
addhook("second","_second")
addhook("leave","_leave")
addhook("join","_join")
addhook("join","adsjoin")
addhook("minute","adsminute")
addhook("clientdata","_clientdata")
addhook("spawn","rspawn")
_say = function (id,txt)
local p = totable(txt)
local cmd = tostring(p[1])
local pl = tonumber(p[2])
if cmd == "!usgn" then
msg2(id,"\169050255050USGN : "..player(id,"usgn").." ")
msg2(id,"\169050255050IP : "..player(id,"ip").." ")
msg2(id,"\169050255050Ping : "..player(id,"ping").." ")
return 1
elseif cmd == "!help" then
msg2(id,"\169255255255-=Help=-")
msg2(id,"\169255255255Script made by P!r@te$ k!ller , USGN : 120840")
msg2(id,"\169255255255Have fun .")
return 1
elseif cmd == "!resetscore" then
parse ("setscore "..id.." 0")
parse ("setdeaths "..id.." 0")
msg("\169050050255Script : Player "..player(id,"name").." has reset his score .")
return 1
elseif cmd == "!rs" then
parse ("setscore "..id.." 0")
parse ("setdeaths "..id.." 0")
msg("\169050050255Script : Player "..player(id,"name").." has reset his score .")
return 1
elseif cmd == "!cmds" then
msg2(id,"\169255255255-=Cmds=-")
msg2(id,"\169255255255!usgn : To see your usgn , ip and ping .")
msg2(id,"\169255255255!help : Just small help ..")
msg2(id,"\169255255255!cmds : To see the cmds .")
msg2(id,"\169255255255!rs : To reset your score .")
msg2(id,"\169255255255!resetscore : To reset your score .")
return 1
end
if flood[id] == 8 then
msg2(id,"\169255000000Script : Stop Spam ! @C")
end
if flood[id] == 15 then
parse("kick "..id.." \" Auto-kicked because of spamming ! \" ")
end
if muted[id] == true then
msg2(id,"\169255255255You are muted, for "..timer_mute.." Seconds")
timer[id] = 5
return 1
end
local r = Player[id].r / 100 * Player[id].v
local g = Player[id].g / 100 * Player[id].v
local b = Player[id].b / 100 * Player[id].v
r = math.floor(r)
g = math.floor(g)
b = math.floor(b)
if r < 10 then
r = "00"..r
elseif r < 100 then
r = "0"..r
end
if g < 10 then
g = "00"..g
elseif g < 100 then
g = "0"..g
end
if b < 10 then
b = "00"..b
elseif b < 100 then
b = "0"..b
end
msg("\169"..r..""..g..""..b..""..player(id,"name")..": "..txt)
flood[id] = flood[id] +1
timer[id] = 5
return 1
end
_serveraction = function (id,action)
if action == 1 then
for _, usgn in ipairs(Admins) do
if player(id,'usgn') == usgn then
menu_admin(id)
return 1
end
end
for _, usgn in ipairs(Mods) do
if player(id,'usgn') == usgn then
menu_mod(id)
return 1
end
end
for _, usgn in ipairs(VIPs) do
if player(id,'usgn') == usgn then
menu_vip(id)
return 1
end
end
end
end
_menu = function (id,title,buton)
if title == "Admin Menu" then
if buton == 1 then
menu_hats(id)
end
if buton == 2 then
menu_color(id)
end
if buton == 3 then
menu_players(id)
end
if buton == 4 then
menu_settings(id)
end
if b==5 and teleportMode[id]==0 then
msg2(id,"©000255111Specail spawn | On")
teleportMode[id]=1
elseif b==5 and teleportMode[id]==1 then
msg2(id,"©000255111Specail spawn | Off")
teleportMode[id]=0
end
end
if title == "Mod Menu" then
if buton == 1 then
menu_hats(id)
end
if buton == 2 then
menu_color(id)
end
if buton == 3 then
menu_players(id)
end
if b==4 and teleportMode[id]==0 then
msg2(id,"©000255111Specail spawn | On")
teleportMode[id]=1
elseif b==4 and teleportMode[id]==1 then
msg2(id,"©000255111Specail spawn | Off")
teleportMode[id]=0
end
end
if title == "VIP Menu" then
if buton == 1 then
menu_hats(id)
end
if buton == 2 then
menu_color(id)
end
end
if title == "Server Settings" then
if buton == 1 then
parse("restart")
end
if buton == 2 then
menu_infammo(id)
end
end
if title == "Infinity Ammo" then
if buton == 1 then
parse("mp_infammo 1")
end
if buton == 2 then
parse("mp_infammo 2")
end
end
if title=="Players Menu" then
if buton==1 then
menu(id,"Kick Page 1,"..existk(1).."|1,"..existk(2).."|2,"..existk(3).."|3,"..existk(4).."|4,"..existk(5).."|5,"..existk(6).."|6,"..existk(7).."|7,"..existk(8).."|8,Next")
elseif buton==2 then
menu(id,"Ban Page 1,"..existb(1).."|1,"..existb(2).."|2,"..existb(3).."|3,"..existb(4).."|4,"..existb(5).."|5,"..existb(6).."|6,"..existb(7).."|7,"..existb(8).."|8,Next")
elseif buton==3 then
menu(id,"Slap Page 1,"..existslap(1).."|1,"..existslap(2).."|2,"..existslap(3).."|3,"..existslap(4).."|4,"..existslap(5).."|5,"..existslap(6).."|6,"..existslap(7).."|7,"..existslap(8).."|8,Next")
end
--- KICK ---
elseif title=="Kick Page 1" then
if buton==9 then
menu(id,"Kick Page 2,"..existk(9).."|9,"..existk(10).."|10,"..existk(11).."|11,"..existk(12).."|12,"..existk(13).."|13,"..existk(14).."|14,"..existk(15).."|15,"..existk(16).."|16,Next")
elseif buton~=0 then
ki(buton)
end
elseif title=="Kick Page 2" then
if buton==9 then
menu(id,"Kick Page 3,"..existk(17).."|17,"..existk(18).."|18,"..existk(19).."|19,"..existk(20).."|20,"..existk(21).."|21,"..existk(22).."|22,"..existk(23).."|23,"..existk(24).."|24,Next")
elseif buton~=0 then
ki(buton+8)
end
elseif title=="Kick Page 3" then
if buton==9 then
menu(id,"Kick Page 4,"..existk(25).."|25,"..existk(26).."|26,"..existk(27).."|27,"..existk(28).."|28,"..existk(29).."|29,"..existk(30).."|30,"..existk(31).."|31,"..existk(32).."|32,Back")
elseif buton~=0 then
ki(buton+16)
end
elseif title=="Kick Page 4" then
if buton~=0 then
ki(buton+24)
end
--- BAN ---
elseif title=="Ban Page 1" then
if buton==9 then
menu(id,"Ban Page 2,"..existb(9).."|9,"..existb(10).."|10,"..existb(11).."|11,"..existb(12).."|12,"..existb(13).."|13,"..existb(14).."|14,"..existb(15).."|15,"..existb(16).."|16,Next")
elseif buton~=0 then
bi(buton)
end
elseif title=="Ban Page 2" then
if buton==9 then
menu(id,"Ban Page 3,"..existb(17).."|17,"..existb(18).."|18,"..existb(19).."|19,"..existb(20).."|20,"..existb(21).."|21,"..existb(22).."|22,"..existb(23).."|23,"..existb(24).."|24,Next")
elseif buton~=0 then
bi(buton+8)
end
elseif title=="Ban Page 3" then
if buton==9 then
menu(id,"Ban Page 4,"..existb(25).."|25,"..existb(26).."|26,"..existb(27).."|27,"..existb(28).."|28,"..existb(29).."|29,"..existb(30).."|30,"..existb(31).."|31,"..existb(32).."|32,Back")
elseif buton~=0 then
bi(buton+16)
end
elseif title=="Ban Page 4" then
if buton~=0 then
bi(buton+24)
end
--- SLAP ---
elseif title=="Slap Page 1" then
if buton==9 then
menu(id,"Slap Page 2,"..existslap(9).."|9,"..existslap(10).."|10,"..existslap(11).."|11,"..existslap(12).."|12,"..existslap(13).."|13,"..existslap(14).."|14,"..existslap(15).."|15,"..existslap(16).."|16,Next")
elseif buton~=0 then
si(buton)
end
elseif title=="Slap Page 2" then
if buton==9 then
menu(id,"Slap Page 3,"..existslap(17).."|17,"..existslap(18).."|18,"..existslap(19).."|19,"..existslap(20).."|20,"..existslap(21).."|21,"..existslap(22).."|22,"..existslap(23).."|23,"..existslap(24).."|24,Next")
elseif buton~=0 then
si(buton+8)
end
elseif title=="Slap Page 3" then
if buton==9 then
menu(id,"Slap Page 4,"..existslap(25).."|25,"..existslap(26).."|26,"..existslap(27).."|27,"..existslap(28).."|28,"..existslap(29).."|29,"..existslap(30).."|30,"..existslap(31).."|31,"..existslap(32).."|32,Back")
elseif buton~=0 then
si(buton+16)
end
elseif title=="Slap Page 4" then
if buton~=0 then
si(buton+24)
end
end
if title == "Hats Menu" then
if buton == 1 then
freeimage(id)
cap_1 = image("gfx/cap.png",1,0,200+id)
imagecolor(cap_1,255,0,0)
elseif buton == 2 then
freeimage(id)
cap_2 = image("gfx/cap.png",1,0,200+id)
imagecolor(cap_2,0,255,0)
elseif buton == 3 then
freeimage(id)
cap_3 = image("gfx/cap.png",1,0,200+id)
imagecolor(cap_3,0,0,255)
elseif buton == 4 then
freeimage(id)
cap_4 = image("gfx/cap.png",1,0,200+id)
imagecolor(cap_4,255,255,0)
elseif buton == 5 then
freeimage(id)
cap_5 = image("gfx/cap.png",1,0,200+id)
imagecolor(cap_5,0,255,255)
elseif buton == 6 then
freeimage(id)
cap_6 = image("gfx/cap.png",1,0,200+id)
imagecolor(cap_6,255,0,255)
elseif buton == 7 then
freeimage(id)
cap_7 = image("gfx/cap.png",1,0,200+id)
imagecolor(cap_7,0,0,0)
elseif buton == 8 then
freeimage(id)
cap_8 = image("gfx/cap.png",1,0,200+id)
imagecolor(cap_8,255,255,255)
elseif buton == 9 then
freeimage(id)
end
end
end
function _die(id)
if Player[id].menu1 == 1 then
freeimage(Player[id].menu1i1)
freeimage(Player[id].menu1i2)
freeimage(Player[id].menu1i3)
freeimage(Player[id].menu1i4)
freeimage(Player[id].menu1i5)
freeimage(Player[id].menu1i6)
Player[id].menu1i1 = nil
Player[id].menu1i2 = nil
Player[id].menu1i3 = nil
Player[id].menu1i4 = nil
Player[id].menu1i5 = nil
Player[id].menu1i6 = nil
Player[id].menu1 = 0
parse('hudtxt2 '..id..' 40 "" 370 165')
parse('hudtxt2 '..id..' 41 "" 255 156')
parse('hudtxt2 '..id..' 42 "" 255 171')
parse('hudtxt2 '..id..' 43 "" 255 186')
end
end
_second = function (id)
for id = 1,32 do
if timer[id] > 0 then
timer[id] = timer[id] -1
else
flood[id] = 0
end
end
for _,id in pairs(player(0,"table")) do
if muted[id] == true then
no_mute[id] = no_mute[id]-1
end
if no_mute[id] == 0 then
muted[id] = false
end
end
parse ("sv_gamemode 1")
parse ('mp_building_limit "barricade" 300')
parse ('mp_building_limit "wall I" 80')
parse ('mp_building_limit "wall II" 120')
parse ('mp_building_limit "wall III" 100')
parse ('mp_building_limit "gate field" 30')
parse ('mp_building_limit "turret" 2')
parse ('mp_building_limit "dispenser" 3')
parse ('mp_building_limit "supply" 2')
parse ('mp_building_limit "Teleporter Entrance" 2')
parse ('mp_building_limit "Teleporter Exit" 2')
end
_leave = function (id)
muted[id] = false
teleportMode[id] = 0
end
_join = function (id)
teleportMode[id] = 0
flood[id] = 0
muted[id] = false
Player[id] = {}
Player[id].menu1 = 0
Player[id].r = 100
Player[id].g = 100
Player[id].b = 100
Player[id].v = 100
end
menu_hats = function (id)
menu (id,"Hats Menu,Cap Red,Cap Green,Cap Blue,Cap Yellow,Cap Cyan,Cap Pink,Cap Black,Cap White,None Cap")
end
menu_admin = function (id)
menu(id,"Admin Menu,Hats Menu,Color Menu,Players Menu,Server Settings,Specail Spawn")
end
menu_mod = function (id)
menu(id,"Mod Menu,Hats Menu,Color Menu,Players Menu,Specail Spawn")
end
menu_vip = function (id)
menu(id,"VIP Menu,Hats Menu,Color Menu")
end
menu_color = function(id)
if Player[id].menu1 == 0 then
Player[id].menu1i1 = image("gfx/yates/lua/shit_colour_menu.png",320,240,2,id)
Player[id].menu1i2 = image("gfx/yates/lua/shit_colour_menu_example.png",320,240,2,id)
Player[id].menu1i3 = image("gfx/yates/lua/shit_colour_menu_arrow.png",192+Player[id].r,230,2,id)
Player[id].menu1i4 = image("gfx/yates/lua/shit_colour_menu_arrow.png",192+Player[id].g,258,2,id)
Player[id].menu1i5 = image("gfx/yates/lua/shit_colour_menu_arrow.png",192+Player[id].b,286,2,id)
Player[id].menu1i6 = image("gfx/yates/lua/shit_colour_menu_arrow.png",338+Player[id].v,198,2,id)
Player[id].menu1 = 1
_updateshitcolourexample(id)
else
freeimage(Player[id].menu1i1)
freeimage(Player[id].menu1i2)
freeimage(Player[id].menu1i3)
freeimage(Player[id].menu1i4)
freeimage(Player[id].menu1i5)
freeimage(Player[id].menu1i6)
Player[id].menu1i1 = nil
Player[id].menu1i2 = nil
Player[id].menu1i3 = nil
Player[id].menu1i4 = nil
Player[id].menu1i5 = nil
Player[id].menu1i6 = nil
Player[id].menu1 = 0
parse('hudtxt2 '..id..' 40 "" 370 165')
parse('hudtxt2 '..id..' 41 "" 255 156')
parse('hudtxt2 '..id..' 42 "" 255 171')
parse('hudtxt2 '..id..' 43 "" 255 186')
end
end
menu_players = function (id)
menu(id,"Players Menu,Kick,Ban,Slap")
end
menu_settings = function (id)
menu(id,"Server Settings,Restart,Infinity Ammo")
end
menu_infammo = function (id)
menu(id,"Infinity Ammo,ON,OFF")
end
function adsjoin(id)
msg2(id,"©30 144255 Welcome on "..game("sv_name").." Server, "..player(id,"name").."!")
end
function adsminute()
msg("©30 144255 Do you want help ? , !cmds .")
end
function ki(pl)
parse("kick "..pl.." \" (kicked) \" ")
end
function bi(pl)
parse("banip "..pl.." \" (banned by ip) \" ")
end
function si(pl)
parse("slap "..pl.."")
end
function existk(param)
if player(param,"exists") then
return player(param,"name")
else
return ""
end
end
function existb(param)
if player(param,"exists") then
return player(param,"name")
else
return ""
end
end
function existslap(param)
if player(param,"exists") then
return player(param,"name")
else
return ""
end
end
function _clientdata(id,mode,data1,data2)
if mode == 0 then
if Player[id].menu1 == 1 then
-- R
if data1 >= 192 and data1 <= 447 and data2 >= 217 and data2 <= 232 then
Player[id].r = (data1 - 192)
end
-- G
if data1 >= 192 and data1 <= 447 and data2 >= 245 and data2 <= 260 then
Player[id].g = (data1 - 192)
end
-- B
if data1 >= 192 and data1 <= 447 and data2 >= 273 and data2 <= 288 then
Player[id].b = (data1 - 192)
end
-- V
if data1 >= 338 and data1 <= 438 and data2 >= 185 and data2 <= 200 then
Player[id].v = (data1 - 338)
end
if data1 >= 200 and data1 <= 440 and data2 >= 305 and data2 <= 330 then
freeimage(Player[id].menu1i1)
freeimage(Player[id].menu1i2)
freeimage(Player[id].menu1i3)
freeimage(Player[id].menu1i4)
freeimage(Player[id].menu1i5)
freeimage(Player[id].menu1i6)
Player[id].menu1i1 = nil
Player[id].menu1i2 = nil
Player[id].menu1i3 = nil
Player[id].menu1i4 = nil
Player[id].menu1i5 = nil
Player[id].menu1i6 = nil
Player[id].menu1 = 0
parse('hudtxt2 '..id..' 40 "" 370 165')
parse('hudtxt2 '..id..' 41 "" 255 156')
parse('hudtxt2 '..id..' 42 "" 255 171')
parse('hudtxt2 '..id..' 43 "" 255 186')
end
_updateshitcolourexample(id)
end
end
end
function _endround()
for _,id in pairs(player(0,"table")) do
if Player[id].menu1 == 1 then
freeimage(Player[id].menu1i1)
freeimage(Player[id].menu1i2)
freeimage(Player[id].menu1i3)
freeimage(Player[id].menu1i4)
freeimage(Player[id].menu1i5)
freeimage(Player[id].menu1i6)
Player[id].menu1i1 = nil
Player[id].menu1i2 = nil
Player[id].menu1i3 = nil
Player[id].menu1i4 = nil
Player[id].menu1i5 = nil
Player[id].menu1i6 = nil
Player[id].menu1 = 0
parse('hudtxt2 '..id..' 40 "" 370 165')
parse('hudtxt2 '..id..' 41 "" 255 156')
parse('hudtxt2 '..id..' 42 "" 255 171')
parse('hudtxt2 '..id..' 43 "" 255 186')
end
end
end
function _updateshitcolourexample(id)
local r = Player[id].r / 100 * Player[id].v
local g = Player[id].g / 100 * Player[id].v
local b = Player[id].b / 100 * Player[id].v
imagecolor(Player[id].menu1i2,r,g,b)
imagepos(Player[id].menu1i3,192+Player[id].r,230,0)
imagepos(Player[id].menu1i4,192+Player[id].g,258,0)
imagepos(Player[id].menu1i5,192+Player[id].b,286,0)
imagepos(Player[id].menu1i6,338+Player[id].v,198,2,id)
parse('hudtxt2 '..id..' 40 "\169255255255V:\169255255255 '..Player[id].v..'" 370 165')
parse('hudtxt2 '..id..' 41 "\169255000000R:\169255255255 '..Player[id].r..'" 255 156')
parse('hudtxt2 '..id..' 42 "\169000255000G:\169255255255 '..Player[id].g..'" 255 171')
parse('hudtxt2 '..id..' 43 "\169000000255B:\169255255255 '..Player[id].b..'" 255 186')
end
function rspawn(id)
for _, usgn in ipairs(rodion) do
if player(id,'usgn') == usgn and teleportMode[id]==1 then
parse("setpos "..id.." 1024 32")
end
for _, usgn in ipairs(tricky) do
if player(id,'usgn') == usgn and teleportMode[id]==1 then
parse("setpos "..id.." 1024 32")
end
for _, usgn in ipairs(nova) do
if player(id,'usgn') == usgn and teleportMode[id]==1 then
parse("setpos "..id.." 1024 32")
end
for _, usgn in ipairs(pirates) do
if player(id,'usgn') == usgn and teleportMode[id]==1 then
parse("setpos "..id.." 6608 2640")
end
for _, usgn in ipairs(hitman) do
if player(id,'usgn') == usgn and teleportMode[id]==1 then
parse("setpos "..id.." 6352 2032")
end
for _, usgn in ipairs(paprika) do
if player(id,'usgn') == usgn and teleportMode[id]==1 then
parse("setpos "..id.." 1024 32")
end
for _, usgn in ipairs(mora) do
if player(id,'usgn') == usgn and teleportMode[id]==1 then
parse("setpos "..id.." 6608 3248")
end
for _, usgn in ipairs(x) do
if player(id,'usgn') == usgn and teleportMode[id]==1 then
parse("setpos "..id.." 1024 32")
end
for _, usgn in ipairs(dragon) do
if player(id,'usgn') == usgn and teleportMode[id]==1 then
parse("setpos "..id.." 1024 32")
end
end
end
end
end
end
end
end
end
end
end
The errors :
1- Put yourself an admin and try to use the color menu , there is a bug , it don't work , it's Yates shit color menu .
2- Put yourself an admin and open menu and press Specail Spawn , it don't work ..
PS :
1- When i try to open the color menu there isn't a error comes in the console but it don't work.
2- When i try to use specail spawn , it gives an error (LUA ERROR: sys/lua/server/F2.lua:582: bad argument #1 to 'ipairs' (table expected, got nil))
3- This script is happy town script and it need a very big map .