English top30 rank server

5 replies
Goto Page
To the start Previous 1 Next To the start
07.06.13 01:42:22 am
Up
tonton2d
User
Offline Off
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
"Akounamatata"
07.06.13 12:31:59 pm
Up
Conscience
User
Offline Off
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.
Remember to learn to forget. Whiskey shots and cheap cigarettes.
07.06.13 12:47:42 pm
Up
omg
User
Offline Off
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
will code for food
07.06.13 01:54:01 pm
Up
tonton2d
User
Offline Off
@consience, to know how much simon says they survived I though about something like :

Code:
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


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

do you know a script using this system?


Code:
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


Code:
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
edited 2×, last 07.06.13 02:06:09 pm
"Akounamatata"
07.06.13 06:53:46 pm
Up
omg
User
Offline Off
you should read up on lua file in/out first. it'll help a lot with debugging and such

http://www.lua.org/pil/21.2.html

it's possible to write to the f1 file, though as i said earlier, doing it in menus will probably be best
will code for food
08.06.13 06:46:12 pm
Up
tonton2d
User
Offline Off
thx for the link... fopen fonction
Here a link of the video to show how the simon says works :
http://www.youtube.com/watch?v=rjRX2ppjOPA
"Akounamatata"
To the start Previous 1 Next To the start