Forum

> > CS2D > Scripts > add USGN
Forums overviewCS2D overview Scripts overviewLog in to reply

English add USGN

23 replies
Page
To the start Previous 1 2 Next To the start

old Re: add USGN

GooDCaT
User Off Offline

Quote
user EngiN33R has written
My mistake. Should be fixed now.

Code >



Thankssss , Works

But USGN, not go to adminlist
she goes to another folder, do not want it
I wanted it to the "adminlist = {}"
adminlist but not for another file, in the same file q ta the command "give", be it over the "adminlist = {}" and when you type the command with USGN, the USGN mensionada go to the "adminlist"

exemple :

@give 1

=
adminlist = {1,}


sorry for my english
edited 2×, last 25.02.12 09:40:49 pm

old Re: add USGN

EP
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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 

addhook("say","a")
function a(id,txt)
local p = totable(txt)
local cmd = (p[1])
	if cmd == "@give" then
		local us = tonumber(p[2])
		File = io.open("sys/lua/<NAMEOFYOURLUA>.lua", "a")
		File:write("\nadminlist = {"..us.."}")
		File:close()
	end
end
this script adds a table to your lua, it doesnt add a value to a table , you need to restart the server to change the values

old Re: add USGN

GooDCaT
User Off Offline

Quote
user EP has written
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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 

addhook("say","a")
function a(id,txt)
local p = totable(txt)
local cmd = (p[1])
	if cmd == "@give" then
		local us = tonumber(p[2])
		File = io.open("sys/lua/<NAMEOFYOURLUA>.lua", "a")
		File:write("\nadminlist = {"..us.."}")
		File:close()
	end
end
this script adds a table to your lua, it doesnt add a value to a table , you need to restart the server to change the values





Thanks, That's The Way I wanted
You overcame Again

Topic Closed (x)
To the start Previous 1 2 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview