Forum

> > CS2D > Scripts > top30 rank server
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch top30 rank server

5 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt top30 rank server

tonton2d
User Off Offline

Zitieren
Hello people, I improved the mini game "simon_says" from the mg_multigame made by mat5b
now I would like to have a rank system based on number of "simon says" that the players can survive
.In my script there is a counter which is incremented at each "simon says" :
So I search a script for having something like this by pressing the F1 bouton ->

Top 30
Nick : coco | usgn : xxxx | simon says survived : 32
//
etc ..

I have no idea how to proceed & how the script I requested would work ;o

alt Re: top30 rank server

Conscience
User Off Offline

Zitieren
I'm not familiar with this script, but if I'm right you should be able to count after every "simon says" which you would then use to check if people are alive and if so +1 on their surviving rounds.

alt Re: top30 rank server

omg
User Off Offline

Zitieren
despite the simplicity, this will end up being a rather large bit of code

you need a save/load system for the rounds survived for each usgn

from all the rounds survived of everyone saved, you need to sort it and have a systematic way to print out the list so that people can see it

easiest way to do the second part would be to use f1, but you would have to keep reloading the -server- in order to see changes. the -best- way to do it would probably to have them print out in an extended menu

alt Re: top30 rank server

tonton2d
User Off Offline

Zitieren
@consience, to know how much simon says they survived I though about something like :

1
2
3
4
if "player die" then
  score=simonsaysround-1
end
-- And then I check if the score is better than the database score


Zitat
you need a save/load system for the rounds survived for each usgn

do you know a script using this system?


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
if "player die" then  
  score=simonsaysround-1  


------Check if the player exist in the database----
	for i=1,number_of_usgn_in_data_base do  
		if player (id,"usgn") == usgn_in_data_base

-- the player exist in database
		 	if score > database_score then
				 score= database_score
--score that the player just made is better than score in database then replace database info --
  
			else
--score in database is better than score that the player just made, do nothing

                	end     
		else 
-- the player doesn't exist in database

              "Create a new line in database & number_of_usgn_in_data_base= number_of_usgn_in_data_base +1 & insert the information about the player" 

		end
 
	end
end


1
from all the rounds survived of everyone saved, you need to sort it and have a systematic way to print out the list so that people can see it

In fact I have no idea how lua can interract with an external files, but as I said at the top, if someone know a script using save/load system plz link
2× editiert, zuletzt 07.06.13 14:06:09
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht