English removing

4 replies
Goto Page
To the start Previous 1 Next To the start
16.05.12 07:03:16 pm
Up
Jhony
User
Offline Off
when i say : !r <USGN>
i delete usgn in folder

example :

Code:
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
16.05.12 07:25:37 pm
Up
krabob
User
Offline Off
Try this..

Code:
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
People help the people
16.05.12 08:16:35 pm
Up
Jhony
User
Offline Off
user krabob has written:
Try this..

Code:
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
edited 1×, last 16.05.12 08:21:29 pm
16.05.12 08:21:01 pm
Up
PyKemis
User
Offline Off
Still might be wrong, but looking at it there is an error that sticks out clearly.

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


to

Code:
1
os.remove("sys/lua/user/"..userd..".txt")
16.05.12 08:21:56 pm
Up
Jhony
User
Offline Off
user PyKemis has written:
Still might be wrong, but looking at it there is an error that sticks out clearly.

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


to

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


yes , i fixed its line
To the start Previous 1 Next To the start