I wanted a script that was so
You typed "@give <USGN>"
Or Something Similar ...
> Not < I want a script like, Please Do not insist
adminlist = {70746}
@give <USGN>
exemple :
@give 1
adminlist = {70746,1}
help me?
please
Scripts
add USGN
add USGN
addhook("say","insertusgn",10001)
function insertusgn(id,t)
	if (t:sub(1,5)=="@give") then
		local usgn=tonumber(t:sub(7))
		table.insert(adminlist,usgn)
		msg2(id,usgn.." has been promoted to admin!")
	end
end
EngiN33R has writtenaddhook("say","insertusgn",10001)
function insertusgn(id,t)
	if (t:sub(1,5)=="@give") then
		local usgn=tonumber(t:sub(7))
		table.insert(adminlist,usgn)
		msg2(id,usgn.." has been promoted to admin!")
	end
end
EngiN33R!
MikuAuahDark has written
EngiN33R!
EngiN33R has written
yes
EngiN33R isn't one to make mistakes, pretty sure you have conflicting hooks.
GooDCaT has written
for i,v in pairs(adminlist) do 	print(string.char(169).."Admin USGN: "..v) end
MikuAuahDark has written
GooDCaT has written
for i,v in pairs(adminlist) do 	print(string.char(169).."Admin USGN: "..v) end
adminlist = {}
addhook("say","insertusgn",10001)
function insertusgn(id,t)
if (t:sub(1,5)=="@give") then
local usgn=tonumber(t:sub(7))
table.insert(adminlist,usgn)
msg2(id,usgn.." has been promoted to admin!")
for i,v in pairs(adminlist) do
print(string.char(169).."Admin USGN: "..v)
end
end
end
adminlist = {}
addhook("say","insertusgn",10001)
function insertusgn(id,t)
	if (t:sub(1,5)=="@give") then
		local usgn=tonumber(t:sub(7))
		table.insert(adminlist,usgn)
		msg2(id,usgn.." has been promoted to admin!")
	end
	for i,v in pairs(adminlist) do
		print(string.char(169).."Admin USGN: "..v)
	end
end
MikuAuahDark has writtenadminlist = {}
addhook("say","insertusgn",10001)
function insertusgn(id,t)
	if (t:sub(1,5)=="@give") then
		local usgn=tonumber(t:sub(7))
		table.insert(adminlist,usgn)
		msg2(id,usgn.." has been promoted to admin!")
	end
	for i,v in pairs(adminlist) do
		print(string.char(169).."Admin USGN: "..v)
	end
end
GooDCaT: oo hmm. so that is you mean? uuu. the script works perfectly!adminlist = {}
addhook("second","addallusgn")
function addallusgn()
	function totable(t,m)
		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
	openfile=io.open("sys/lua/adminlist.txt")
	for line in openfile:lines do
		parses=totable(line)
		if line~=nil then
			if tonumber(parses[1])~=nil then
				table.insert(adminlist,tonumber(parses[1]))
			end
		end
	end
	freehook("second","addallusgn")
end
addhook("say","insertusgn",10001)
function insertusgn(id,t)
	if (t:sub(1,5)=="@give") then
		local usgn=tonumber(t:sub(7))
		table.insert(adminlist,usgn)
		msg2(id,usgn.." has been promoted to admin!")
		saveusgn = io.open("sys/lua/adminlistfile.txt")
		saveusgn:write("\n"..usgn)
	end
end
Re: add USGNadminlist = {}
addhook("second","addallusgn")
function addallusgn()
function totable(t,m)
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
openfile=io.open("sys/lua/adminlist.txt")
for line in openfile:lines do
parses=totable(line)
if line~=nil then
if tonumber(parses[1])~=nil then
table.insert(adminlist,tonumber(parses[1]))
end
end
end
freehook("second","addallusgn")
end
addhook("say","insertusgn",10001)
function insertusgn(id,t)
if (t:sub(1,5)=="@give") then
local usgn=tonumber(t:sub(7))
table.insert(adminlist,usgn)
msg2(id,usgn.." has been promoted to admin!")
saveusgn = io.open("sys/lua/adminlistfile.txt")
saveusgn:write("\n"..usgn)
end
end
MikuAuahDark: I haven't suggested to make it like this and I'm not sure if
GooDCaT wanted that initially. Nevertheless, since he approves, I haven't seen code messier than this in a while. You don't need to add a second hook, do everything inside it and then free it. Better version - USGN reading function is executed upon first script execution.
EngiN33R has written
MikuAuahDark: I haven't suggested to make it like this and I'm not sure if
GooDCaT wanted that initially. Nevertheless, since he approves, I haven't seen code messier than this in a while. You don't need to add a second hook, do everything inside it and then free it. Better version - USGN reading function is executed upon first script execution.
@give 1
LUA ERROR: sys/lua/server.lua:34: attempt to index global 'saveusgn' (a nil value)
( help me URGENT )