Online highscores engine
Filed under: Editables, Scripts
- GM Version: GM8 Pro
- File Type: gmk
- File Size: 1.6mb from the zip, and about 19mb from the GeoLite database
- File Link: Zip file – GeoLiteCity database
Note: The zip includes an example hosted by me and all the required files to install it on your server!
Requirements before installing in your server:
_Your server must be able to handle php.
_A mysql database.
_All files linked above.
_A little knowledge on databases and (maybe) some php.
Getting started:
First, we need to set up a new MySql table in our database, it needs to be called “scores_0″ ( the name may vary, but to do that you need to edit all the php files from the example with the new name! )
Structure of the new table:
Scores_0
– ip > varchar (255)
– name > varchar (255)
– scorea > int(255)
– scoreb > int(255)
– date > datetime
After the database is succesfully created, decompress the zip file with the exe and the gmk files, go to the “Upload” directory and open the “Config.php” file. There, replace the variables with your database settings (username, password, database name and host)
Now we need to upload the files. the file inside the “Upload” directory are the ones you need to upload to your server, and they need to be together in the same folder (i reccomend creating a new folder to put the files in, too keep it organized).
After you uploaded those files, download the GeoLiteCity Database, this is vital to show the flags in the highscores table! Once downloaded, you will get a .gz file, extract it and upload the GeoLiteCity.dat file to the same folder you uploaded all the other files.
Its time to get started with the gmk file! As you can see, it has all the settings to connect to my test database (the one you see when you run the example), we are going to change this so you can connect to your server: Go to the scripts refresh_hs and submit_hs, there replace the urls of the php files for the new ones (the link to your server).
ie: if your files are hosted in ‘http://domain.com/somefolder/’, the new link in ‘refresh_hs’ will be:
site = 'http://domain.com/somefolder/singleline.php?line='+string(now);
and in ‘submit_hs’:
site = 'http://domain.com/somefolder/insert.php?name='+name+'&scorea='+scorea;
we also need to modify the ‘get_country’ script:
site = 'http://domain.com/somefolder/a.php?ip_a='+argument0;
Thats it! save the file, and check it by yourself!
have fun :)

