Forum

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

Englisch removing

4 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt removing

Jhony
User Off Offline

Zitieren
when i say : !r <USGN>
i delete usgn in folder

example :

1
2
3
4
5
6
7
8
addhook('say','multi')
function multi(id,txt)
local userd = tonumber (p[2])
if (txt=="!r") then
os.remove(sys/lua/user/"..userd..".txt")
return 1
end
end

alt Re: removing

krabob
User Off Offline

Zitieren
Try this..

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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','multi')
function multi(id,txt)
p = totable(txt)
if string.sub(txt,1,2) == "!r" then
userd = tonumber (p[2])
os.remove(sys/lua/user/"..userd..".txt")
return 1
end
end

alt Re: removing

Jhony
User Off Offline

Zitieren
user krabob hat geschrieben
Try this..

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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','multi')
function multi(id,txt)
p = totable(txt)
if string.sub(txt,1,2) == "!r" then
userd = tonumber (p[2])
os.remove(sys/lua/user/"..userd..".txt")
return 1
end
end


opss ... ! , have error but i fixed
fine works
thank you man
1× editiert, zuletzt 16.05.12 20:21:29

alt Re: removing

Apache uwu
User Off Offline

Zitieren
Still might be wrong, but looking at it there is an error that sticks out clearly.

1
os.remove(sys/lua/user/"..userd..".txt")

to

1
os.remove("sys/lua/user/"..userd..".txt")

alt Re: removing

Jhony
User Off Offline

Zitieren
user Apache uwu hat geschrieben
Still might be wrong, but looking at it there is an error that sticks out clearly.

1
os.remove(sys/lua/user/"..userd..".txt")

to

1
os.remove("sys/lua/user/"..userd..".txt")


yes , i fixed its line
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht