Forum

> > CS2D > Scripts > how can i do this "hhsave(1,2,3,4.....)"
Forums overviewCS2D overview Scripts overviewLog in to reply

English how can i do this "hhsave(1,2,3,4.....)"

8 replies
To the start Previous 1 Next To the start

old how can i do this "hhsave(1,2,3,4.....)"

loldlold123
User Off Offline

Quote
function hhsave(id)
codes
codes
codes
end
end

but i want to add one features...

save all players money etc...

but i dont want do this

hhsave(1)
hhsave(2)
hhsave(3)
....
...
..
.

how can i make this

hhsave(1,2,3,4,5)
?

old Re: how can i do this "hhsave(1,2,3,4.....)"

kalis
User Off Offline

Quote
you mean save each , each ,.. ?
Like this ?
1
2
3
4
5
local text = ""
	text = text .." "..money
	text = text .." "..money2
	text = text .." "..money3
ect ...

Ang the file saved like :
111 111 111
money 1 : 111
money 2 :111
money 3 : 111

old Re: how can i do this "hhsave(1,2,3,4.....)"

Flacko
User Off Offline

Quote
I think you mean something like this:
1
2
3
4
5
6
7
8
9
10
11
12
function hhsave(...)
	local f = io.open('file.txt','w')
	if f then
		for i=1,#arg do
			f:write(arg[i],' ')
		end
		f:write('\n')
		return true
	else
		return false
	end
end
edited 1×, last 27.07.11 08:42:47 pm

old Re: how can i do this "hhsave(1,2,3,4.....)"

MikuAuahDark
User Off Offline

Quote
maybe this code work:
1
2
3
4
5
6
7
function hhsave(id)
file = io.open("sys/lua/hhsave/"..player(id,"usgn..'.txt', "w+") or io.tmpfile()	-- sys/lua/hhsave only example directory
local text = ""
text = text .." "..(array name)[id]	-- to add more save text you must copy "text = text .." ".." then put your array name. (array name) change it to your array name
file:write(text)		-- add this after text = text .." "..(array name)[id]
file:close
end
just test it.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview