English [474] - HappyTown/Admin Lua v1.3 icon

162 comments
21.07.12 12:02:20 am
like 44 like it!
14 kb, 2,235 Downloads
Chingy
User
Offline Off
Some people knew my server, some not. I don't care about them. Now here's the Lua. It has got nearly everything what an administrative Lua Script needs.

This script is used by "@" commands, not through a menu.

> You can open the help ingame by writing @help 1 and @help 2.
> Teleportation is usable with F4. It teleports you to your Mouse Targeted Position.
> F3 will open a hat menu.
> F2 will open a Menu for Member, Mod, GM & Admin.
> AntiKillArea is contained. Starts working by adding coordinates to it.
-----------

Updates >

Editing the AntiKillArea >

Changing the rank colors >


INFO
I won't continue the script. There will be no further updates.
I allow you to edit this script for your own use only.
If you want to reupload a modified version of this script, send me a pm and put me into the credits.

#Chingy
imageimage
edited 41×, last 13.07.13 12:55:49 am
ok This file has been reviewed and approved by Yates (04.12.15 11:19:28 am)

Comments

162 comments
Goto Page
To the start Previous 1 2 3 4 5 6 7 8 9 Next To the start

Log in!

You need to log in to be able to write comments!Log in
21.08.12 01:34:51 pm
Up
Glix
User
Offline Off
This don't work!
edited 1×, last 25.08.12 01:14:17 pm
30.07.12 11:31:12 am
Up
Chingy
User
Offline Off
@user Deathliger: Because you're to stupid to use a Lua script?
"Shit your dumbness error F.U.C.K"
30.07.12 03:15:30 am
Up
Deathliger
User
Offline Off
tested and got some error
edited 1×, last 19.04.17 02:34:00 pm
29.07.12 06:31:56 pm
like I like it!
Up
dizziness
User
Offline Off
- Short Message
Nice, I will take something from your lua script.

I don't mean to steal, I can create it too. I just don't want to write it anymore because I no longer like to play Counter-Strike: 2D, I just host a server.

Sayonara
28.07.12 07:19:29 am
Up
DevGru
User
Offline Off
@user mihailo: Use the damn code tag!

Code:
1
[code]<Enter the fucking code here>[/ code]
28.07.12 06:48:14 am
Up
Deathliger
User
Offline Off
i know, i mean the map on this file ss
edited 1×, last 19.04.17 02:34:22 pm
27.07.12 10:16:26 pm
like I like it!
Up
Shawni
User
Offline Off
@user Deathliger: What a map your talking about ? this is a script
27.07.12 08:09:28 pm
Up
Deathliger
User
Offline Off
did you include the map on your ss too?
edited 1×, last 19.04.17 02:34:44 pm
27.07.12 08:10:56 am
Up
Chingy
User
Offline Off
@user Shawni: Yeah, maybe I would make 2 versions of it. One with editable stuff and another just as standart. Thanks for the idea.
25.07.12 12:54:58 am
like I like it!
Up
Shawni
User
Offline Off
@user RedizGaming: Hey ! am not tank! , you should say thank to user Chingy:
@user Chingy: this script use safezone Pos, Admin house Pos, The open command Pos I was think that player like user RedizGaming: dont know how change that.
edited 1×, last 27.07.12 01:20:21 pm
24.07.12 10:27:44 pm
like I like it!
Up
RedizGaming
GAME BANNED
Offline Off
Tanks @user Shawni:
23.07.12 10:53:26 am
like I like it!
Up
songoku123
User
Offline Off
i very like
23.07.12 12:03:35 am
Up
Chingy
User
Offline Off
Wrong, you can use it for every map. But if you want to use the @open command you need to change their coordinates. You can use buttos with them to open closed houses or trigger something.
@user RedizGaming: You also could ask me because I uploaded the file.
@user Shawni: I changed some stuff there what is not so important. Also I added an Anti-Shopkill-Area. You cann add coordinates there and if someone would attack in that area he will be killed with a "No Shopkilling!" message. But it's bugged a bit.
22.07.12 09:57:47 pm
like I like it!
Up
Shawni
User
Offline Off
That map was using a map called BAC Happytown
and @user Chingy: Changed something in this script so right now i think, you should use the 474 clan map(Chingy clan, am not sure it called 474)
22.07.12 08:55:53 pm
like I like it!
Up
RedizGaming
GAME BANNED
Offline Off
@user EP: What Map Use This Script?
Pliz Answer
21.07.12 11:20:04 pm
Up
Chingy
User
Offline Off
@user mihailo: Next time just send me only a PM.
21.07.12 11:01:17 pm
like I like it!
Up
Suprise
BANNED
Offline Off
oh my jesus
21.07.12 10:59:18 pm
Up
krabob
User
Offline Off
@user mihailo: Wow, you're just..
21.07.12 10:54:44 pm
like I like it!
Up
mihailo
User
Offline Off
man why when i start this script in cs2d me write

Lua Error:sys/lua/server.lua:21: unexteped symole near "/"


Pls who know fix do it





--Script by Blairstring, edited by Chingy--
--Don't even think about it to say it's yours!--
news_delay=5
news_id=36
clanname = "[474]Happy Town"
webpage = "happytown474.forumj.net"
houses = {Member = {138,139},
           Admin = {15,145}}
cmds = {colors = {member = "255255000",
                     mod = "000000255",
                     admin = "255255255",
                     gm = "255161110"},
          pm = {"@pm",1,"ID MSG (min level: member)","Sends a private message"},
          say = {"@say",1,"MSG (min level: member)","Says a message with your rank's color"},
          report = {"@report",1,"ID REASON (min level: member)","Reports a player"},
          mute = {"@mute",2,"ID (min level: MOD)","Mutes a player. Use it again to unmute"},
          kick = {"@kick",2,"ID (min level: MOD)","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: GM)","Bans 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: Admin)","Equips you an item"},
          rcon = {"@rcon",4,"CMD (min level: Admin)","Parses a command"},
          grab = {"@grab",4,"ID (min level: Admin)","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] == "admin" then
                                   return 4
                              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 do not have enough level to do this!",2)
end
function noe(id)
     m(id,"255000000","This player does not 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,Admin 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") == 48086 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 message has been succesfully sent to "..player(pl,"name"),2)
                                   else
                                        m(id,"255000000","You can't send a private message to 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").." (MOD): "..message,1)
                              elseif level[id] == 3 then
                                   m(id,cmds.colors.gm,player(id,"name").." (GM): "..message,1)
                              elseif level[id] == 4 then
                                   m(id,cmds.colors.admin,player(id,"name").." (ADM): "..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","Report to "..player(pl,"name").." has been writen!",2)
                                   m(id,"000255000","Cause: "..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 unmuted "..player(pl,"name"),2)
                                   elseif mute[pl] == false then
                                        mute[pl] = true
                                        m(pl,"255000000","You have been muted!",2)
                                        m(id,"255000000","You have 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 (he doesn't have 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").." a MEMBER!",2)
                                        else
                                             noadm(id)
                                        end
                                   elseif rank == "mod" then
                                        if level[id] >= 4 then
                                             level[pl] = 2
                                             m(pl,"000255000","Your new power is MOD!",2)
                                             m(id,"000255000","You have made "..player(pl,"name").." a MOD!",2)
                                        else
                                             noadm(id)
                                        end
                                   elseif rank == "admin" then
                                        if level[id] >= 4 then
                                             level[pl] = 3
                                             m(pl,"000255000","Your new power is ADMIN!",2)
                                             m(id,"000255000","You have made "..player(pl,"name").." a ADMIN!",2)
                                        else
                                             noadm(id)
                                        end
                                   else
                                        csyntax(id,"Correct syntax: @make PL member/mod/admin")
                                   end
                              else
                                   noe(id)
                              end
                         else
                              csyntax(id,"Correct syntax: @make PL member/mod/admin")
                         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,,,,,,,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,"Admin Menu,FN F2000,Heavy Armor,Medic Armor,M134,Tmp,Superarmor,GOD MODE,,Teleport")
          end
     elseif a == 2 then
          menu(id,"Hats menu,Helmet,Spikes,Phoenix,Corner,Tyrans,Headcrab,Pikachu,Pinocchio,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
               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 == "Admin 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 == "Hats menu" then
          if b == 1 then
               if hat[id] ~= nil then
                    freeimage(hat[id])
               end
               hat[id] = image("gfx/hats/helmet.bmp",1,1,200+id)
          elseif b == 2 then
               if hat[id] ~= nil then
                    freeimage(hat[id])
               end
               hat[id] = image("gfx/hats/spikes.png",1,1,200+id)
          elseif b == 3 then
               if hat[id] ~= nil then
                    freeimage(hat[id])
               end
               hat[id] = image("gfx/hats/phoenix.png",1,1,200+id)
          elseif b == 4 then
               if hat[id] ~= nil then
                    freeimage(hat[id])
               end
               hat[id] = image("gfx/hats/wing5.bmp",1,1,200+id)
          elseif b == 5 then
               if hat[id] ~= nil then
                    freeimage(hat[id])
               end
               hat[id] = image("gfx/hats/tyrans.bmp",1,1,200+id)
          elseif b == 6 then
               if hat[id] ~= nil then
                    freeimage(hat[id])
               end
               hat[id] = image("gfx/hats/headcrab.png",1,1,200+id)
          elseif b == 7 then
               if hat[id] ~= nil then
                    freeimage(hat[id])
               end
               hat[id] = image("gfx/hats/pikachu.png",1,1,200+id)
          elseif b == 8 then
               if hat[id] ~= nil then
                    freeimage(hat[id])
               end
               hat[id] = image("gfx/hats/pinocchio.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
kt = {x1 = {42}, y1 = {94}, x2 = {58}, y2 = {110}}
function zone(x1, y1, x2, y2)
table.insert(kt.x1, x1)
table.insert(kt.x2, x2)
table.insert(kt.y1, y1)
table.insert(kt.y2, y2)
end

--Settings
zone(3,11,22,30) -- Zone coö.
attack_limit = 0
atk_msg = "No shopattacking! - %s"

for i = 1, 32 do
kt[i] = attack_limit
end

function f2(id)
for ix1, x1 in ipairs(kt.x1) do
for iy1, y1 in ipairs(kt.y1) do
for ix2, x2 in ipairs(kt.x2) do
for iy2, y2 in ipairs(kt.y2) do
if ix1 == iy1 and iy1 == ix2 and ix2 == iy2 then
if player(id, "tilex") < x2 and player(id, "tilex") > x1 and player(id, "tiley") > y1 and player(id, "tiley") < y2 then
return true
end
end
end
end
end
end
return false
end

addhook("attack","attack_hook")
function attack_hook(id)
if f2(id) then
msg2(id,string.format(atk_msg, kt[id]..'/'..attack_limit))
if kt[id] <= 0 then
parse("killplayer "..id.."; No shopattacking!")
end
kt[id] = kt[id] - 1
end
end

addhook([[leave]], [[leave_hook]])
function leave_hook(id, r)
kt[id] = attack_limit
end



send me fixed ok man ?
21.07.12 10:47:41 pm
like I like it!
Up
Xirot
User
Offline Off
hahahha , Im waiting this upload for long while.
To the start Previous 1 2 3 4 5 6 7 8 9 Next To the start