Forum

> > CS2D > Scripts > Helping Scripts
Forums overviewCS2D overview Scripts overviewLog in to reply

English Helping Scripts

5 replies
To the start Previous 1 Next To the start

old Helping Scripts

Syph
User Off Offline

Quote
Can some 1 paste here helping scripts
like
Array
and some helping functions please ?
also save and load script !
edited 1×, last 31.01.11 04:40:22 pm

old Re: Helping Scripts

Yasday
User Off Offline

Quote
More >


Load and Save:
More >


(Maybe they don't work, didn't try them.)

old Re: Helping Scripts

Yasday
User Off Offline

Quote
Load(with the fileline function 2 posts higher):
1
fileline(PATH_OF_FILE,LINE_OF_FILE)

Save(with the save function 2 posts higher):
1
save(PATH_OF_FILE,WHAT_TO_SAVE)

old Re: Helping Scripts

Syph
User Off Offline

Quote
i did just understand the path of file but what you mean with line of file
do you mean that i cant do just in 1 line ?
i want to save like
file :
lua/saves/<usgn>.lua
in it :
I WANT JUST 1 line that says
<points> <admin_level> <kills> <coins>

also i said i want to know how to do
not that i know how to the save/load function
i just want to know the second thing
well
it meant to be
function load(id)
if player(id,"usgn")~=0 then
local usgn=player(id,"usgn")
local f=io.open("sys/lua/saves/"..usgn..".lua","r")


end
end
just like that
but how i do like
points[id]=<points>
and that (THE THINGS NEED TO BE WITH A SPACE LIKE)
<points> <blabla>

old Re: Helping Scripts

Yasday
User Off Offline

Quote
Save:
1
save(PATH_OF_FILE,points[id].." "..blabla[id].." "..blablabla[id])

Load:
1
2
3
4
5
6
7
8
9
10
11
12
13
local bla = toTable(fileline(PATH_OF_FILE,1))
points[id] = tonumber(bla[1])
blabla[id] = tonumber(bla[2])
--if you need a boolean use this function:
function toboolean(txt)
	if txt == "true" then
		return true
	elseif txt == "false" then
		return true
	end
end
--use:
blablabla[id] = toboolean(bla[3])--boolean = true or false..

Enough?
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview