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

acess={12263}
lockt=0
lockct=0

addhook("say","lock")
function lock(id,txt)
t=totable(txt)
for _, usgn in ipairs(acess) do
if player(id,"usgn")== usgn then
if txt== "!lockct" then
lockct=1
msg2(id,"000255000Counter-Terrorist Locked")
return 1
elseif txt== "!lockt" then
lockt=1
msg2(id,"000255000Terrorist Locked")
return 1
elseif txt== "!lockall" then
lockct=1
lockt=1
msg2(id,"000255000All teams Locked")
return 1
elseif txt== "!unlockct" then
lockct=0
msg2(id,"000255000Counter-Terrorist Unlocked")
return 1
elseif txt== "!unlockt" then
lockt=0
msg2(id,"000255000Terrorist Unlocked")
return 1
elseif txt== "!unlockall" then
lockct=0
lockt=0
msg2(id,"000255000All teams Unlocked")
return 1
end
if t[1]=="!makespec" and t[2]~= nil then
if player(t[2],"exists") then
parse("makespec "..t[2].."")
return 1
end
end
if t[1]=="!maket" and t[2]~= nil then
if player(t[2],"exists") then
parse("maket "..t[2].."")
return 1
end
end
if t[1]=="!makect" and t[2]~= nil then
if player(t[2],"exists") then
parse("makect "..t[2].."")
return 1
end
end
end
end
end

addhook("team","lock2")
function lock2(id,team,look)
if lockct== 1 and team== 2 then
parse("makespec "..id.."")
msg2(id,"255000000Counter-Terrorist Locked@C")
return 1
end
if lockt== 1 and team== 1 then
parse("makespec "..id.."")
msg2(id,"255000000Terrorist Locked@C")
return 1
end
end
