Addon Entry

Now supporting the newest garrysmods.org

New : UserScript to add a search button to any garrysmod.org download page Script Page Install It!

Mirrors

There are no mirrors, request one in the comment section below.
File: GSessions - Statistics Mod
Version: 0
Garrysmod.org URL: http://www.garrysmod.org/downloads/?a=view&id=46383
Description: this script is a small example of how to write a "stats system" that not only stores the users current session information, but reloads the information when the user re-enters the game. this is extremely useful for things such as storing frags, deaths, props spawned, money, or anything else that you might go about counting. also has a tiny section on how to go about doing an achievement type system (currently gives an achievement on 25 kills, 50 kills, and 100 kills).

with that said, the example provided in the script is able to count a users frags and deaths, and carry these across sessions. if you type 'statsme' in console, it brings up the vgui which displays not only your information, but other in-game users as well.

all stats are organized into their respective folders (i would go with keyvalues and tables, but eh...this is easier for n00bs to learn from and thats the point of it), so you can expect a very "filing cabinet" type database in your data/ folder. functions are commented on to explain their function (if you couldnt already figure it out from the functions name).

drop this into your lua/autorun/ folder, and for those wondering, this is half clientside and half serverside (stats engine is serverside, vgui is clientside).

credits:
well, this script is basically a giant chunk of code from my gamemode g-fortress, so full credit to me. the reason i am sharing this is because i wanted other people who are writing gamemodes to use this example and figure out how they might want to go about writing a saved session system into their gamemode. i may convert this to sqllite at some point as well. thanks, enjoy, and please give a little credit for the my effort if you do end up integrating this into a gamemode or addon.

Image: GSessions