Forum

> > CS2D > Scripts > [need script] toplist
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch [need script] toplist

4 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt [need script] toplist

HaRe
User Off Offline

Zitieren
I'm making an CS2D toplist with functions that the current one doesn't this toplist is coded in PHP which the other one isn't so to make this work i will need a LUA Script that is saving all kills and deaths in an text file that looks something like this

1
2
3
4
5
NAME|USGN|2|1
NAME|USGN|9|3
NAME|USGN|1|2

>NAME | USGN | KILLS | DEATHS<

Notice that the order doesn't matter, So if anyone could help i'd be happy to continue this project.

The functions i'm going to add is an admin panel and an main page with the top list. There will also be site side functions so you can change etc icon of page, title of page, change users kills and deaths. There will also be an search function to search after the USGN ID and also getting the rank id.

alt Re: [need script] toplist

HaRe
User Off Offline

Zitieren
Thanks, But i'd like to have an lua script that saves into an text document not an dat document.

alt Re: [need script] toplist

EngiN33R
Moderator Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
function dumpscores()
	local f=assert(io.open("sys/scores.txt","w"))
	for _,id in pairs(player(0,"table")) do
		f:write(player(id,"name").."|"..player(id,"usgn").."|"..player(id,"score").."|"..player(id,"deaths").."\n")
	end
	f:close()
end

dumpscores()

I think this should work.

alt Re: [need script] toplist

HaRe
User Off Offline

Zitieren
Awesome thanks, A question does it overwrite the existing USGN, also does it check if the player has an usgn if not it shouldn't save the user.

Edit: Just noticed that it doesn't write the overall score (oldscore+newscore) & (olddeaths+newdeaths).
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht