Forum

> > CS2D > Scripts > add USGN
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch add USGN

23 Antworten
Seite
Zum Anfang Vorherige 1 2 Nächste Zum Anfang

alt Re: add USGN

GooDCaT
User Off Offline

Zitieren
user EngiN33R hat geschrieben
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
2× editiert, zuletzt 25.02.12 21:40:49

alt Re: add USGN

EP
User Off Offline

Zitieren
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

alt Re: add USGN

GooDCaT
User Off Offline

Zitieren
user EP hat geschrieben
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)
Zum Anfang Vorherige 1 2 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht