SA-MP Forums Archive
[FilterScript] [FS/PHP/MySQL]RStats - Detailed player stats for SA-MP - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] [FS/PHP/MySQL]RStats - Detailed player stats for SA-MP (/showthread.php?tid=377360)



[FS/PHP/MySQL]RStats - Detailed player stats for SA-MP - R@f - 13.09.2012

RStats - Detailed player stats for SA-MP
ABOUT
RStats is a free project (SA-MP Filterscript and Web interface) for SA-MP which allows you to get detailled statistics from your players and keeps a history of it. With the well designed database of RStats you can extract a lot of information about players (time they spend each day on the server for example), use your imagination

Main features Information
I'm currently working on a V2 (complete rewrite), please don't use this version, it's old and unsecure.
The web interface is still in developement, but you can use the filterscript and collect stats to use for the coming panel.
Important : It's just a stats filterscript and not a register/login one ! The accounts are not protected, use another system for that.

Author
This project was developped by Rafael 'R@f' Keramidas <rafael [AT] keramid [DOT] as>.

Donations
If you like this project or make a commercial use for it, please donate via paypal at rafael.keramidas [AT] gmail [DOT] com. Of course you don't have to but it would be nice if you do

Credits/Thanks
BlueG : For his MySQL Plugin.

LICENCE
This project is released under GPLv3. Read the GPLv3.txt for more information.

DOWNLOAD
You can get the project on Github : http://roflc.at/8z

How to download the zip archive ?
Take a look at this screenshot : http://rafael.keramid.as/rpanel/howtodl.png

REQUIRED (SA-MP) REQUIRED (Web Server) INSTALL (SA-MP)
1. Create the tables using the SQL Code located in the "SQL" folder.
2. Get the Filterscript located in the "Filterscript" folder and place it where you want.
3. Change the MySQL Credentials and ajust the settings like you want and compile it.
4. Use it !

INSTALL (Web)
Coming

COMMANDS (SA-MP)
/mystats : Shows your own stats.
/stats [playerid] : Shows the stats of a given player ID.

SCREENSHOT
SA-MP
http://i.imgur.com/KIBDL.jpg

Web
None

DATABASE
A view on the MySQL Database design :


SUPPORT
I don't give ANY support for the installation or usage of this script, so please don't contact me for that !!
If you found a bug, write me at rafael [AT] keramid [DOT] as and don't forget to put "RStats" in the subject.

CHANGELOG
V1.0 - 13th September 2012 TODO
V1.1

Enjoy


Re: [FS/PHP/MySQL]RStats - Detailed player stats for SA-MP - EliteDrive - 13.09.2012

Very nice good job man!


Re: [FS/PHP/MySQL]RStats - Detailed player stats for SA-MP - CeLo Jeaam - 13.09.2012

nice


Re: [FS/PHP/MySQL]RStats - Detailed player stats for SA-MP - jpeg - 13.09.2012

Very Nice!


Re: [FS/PHP/MySQL]RStats - Detailed player stats for SA-MP - Ricop522 - 13.09.2012

playerid under rstats_chatmessage?
why not the name?


Re: [FS/PHP/MySQL]RStats - Detailed player stats for SA-MP - R@f - 14.09.2012

Quote:
Originally Posted by Ricop522
Посмотреть сообщение
playerid under rstats_chatmessage?
why not the name?
Playerid (foreign key) is used in every other table because it's a normalized database (http://en.wikipedia.org/wiki/Database_normalization). If you want to get the username and the message in the same query you have to do a SQL Join, like this (didn't tried it). :
Код:
SELECT u.username AS username, c.chatmsg AS message FROM rstats_chatmessages INNER JOIN rstats_users u ON u.userid = c.playerid WHERE u.username = 1;
---

Thanks for the comments.


Re: [FS/PHP/MySQL]RStats - Detailed player stats for SA-MP - CeLo Jeaam - 14.09.2012

Grab em home server?
Because it's always in FilterScript bug. -.


Re: [FS/PHP/MySQL]RStats - Detailed player stats for SA-MP - Mr.Faqahat - 29.09.2012

Very nice can you put a sample picture of web


Re: [FS/PHP/MySQL]RStats - Detailed player stats for SA-MP - M3mPHi$_S3 - 29.09.2012

That's realy nice. Forsure i will use it


Re: [FS/PHP/MySQL]RStats - Detailed player stats for SA-MP - Edvin - 08.10.2012

Another nice project


Re: [FS/PHP/MySQL]RStats - Detailed player stats for SA-MP - CrusherCpt - 09.10.2012

Nice and usefull for RPG servers.. Good Work


Re: [FS/PHP/MySQL]RStats - Detailed player stats for SA-MP - AMEENAMEEN - 25.11.2012

Can you do an ftp version for people with non mysql scripts


Re: [FS/PHP/MySQL]RStats - Detailed player stats for SA-MP - Johnson_boy - 26.11.2012

Looks pretty nice, but I spotted some rather nasty mistakes.

Код:
// OnPlayerText
format(sMysqlQuery, sizeof(sMysqlQuery), "INSERT INTO rstats_chatmessages VALUES(null, %d, '%s', NOW())", iUserid[playerid], text);
mysql_query(sMysqlQuery);
Код:
// OnPlayerCommandText
format(sMysqlQuery, sizeof(sMysqlQuery), "INSERT INTO rstats_commands VALUES(null, %d, '%s', NOW())", iUserid[playerid], cmdtext);
mysql_query(sMysqlQuery);
The user input is not escaped, which means if someone says for instance "It's a pencil", the query will fail. (because of the apostrophe).

However, not all people are nice, and someone might say
Код:
'); DROP TABLE `rstats_users`; /*
which would delete the whole table. Even if you do not allow the MySQL user to drop or truncate, someone could still ruin all your data with simple update queries. For instance
Код:
'); UPDATE `rstats_users` SET `score` = 0 WHERE 1; /*
would set everyone's score to 0.

Both queries would run just fine, but the database server would interpret that as multiple queries: INSERT INTO rstats_chatmessages VALUES(null, %d, ''); DROP TABLE `rstat_users`; /* , NOW())
The part after /* will be interpreted as comment and therefore omitted.

So I highly recommend you to escape all user input to prevent mysql injections.


Re: [FS/PHP/MySQL]RStats - Detailed player stats for SA-MP - TheChimpJr - 27.11.2012

Now thats good xD


Re: [FS/PHP/MySQL]RStats - Detailed player stats for SA-MP - RevCeo - 09.09.2013

Update download link, it dose not work!


Re: [FS/PHP/MySQL]RStats - Detailed player stats for SA-MP - awsomedude - 09.09.2013

https://github.com/RafaelKeramidas/RStats

Here you go


Re: [FS/PHP/MySQL]RStats - Detailed player stats for SA-MP - RevCeo - 14.09.2013

Quote:
Originally Posted by awsomedude
Посмотреть сообщение
Thanks mate.!