[FilterScript] [MySQL] Friend System
#1

Hi there!

I had some free time and decided to script a friend list feature (using MySQL to store/extract data).
Once someone enters a name (or ID if online), it will be compared with the `Username` column in the accounts database.

The DBID will be extracted and added to a new database, along with the player's DBID.

A .zip package can be found in the attachments. And here is a mirror:
Download Here

Make sure to change all MySQL name values to your own database's.

Default is:
Player accounts DB: `accounts`
Friend DB: `friendsdb`

Account ID in accounts DB: `id`
Username in accounts DB: `Username`


Commands:

/addfriend [NAME / ID] - Adds a friend to your friendlist.
/friends - Displays a list of all the players you are befriended with.


How it works:
5 = "Farva"
5014 = "Benny_McCabe"
12340 = "Eddie_Murphy"
55100 = "Sam_Jingles"

"Sam_Jingles" (55100) enters the command:
"/addfriend eddie_murphy" (or when "Eddie_Murphy" is online, he can simply enter "/addfriend [ID]" or "/addfriend Eddie)

"Eddie_Murphy"'s DBID will be copied into a new entry in the `friendsdb` database, linking it to "Sam_Jingles".
After a while, Sam_Jingles has made some friends. The database will look like this:



Once "Sam_Jingles" enters the command: "/friends", he will get a friendlist that links the `FriendID` in the `friendsdb` database back to the usernames in the original accounts database.
"Sam_Jingles" is befriended with: "Farva", "Benny_McCabe", "Eddie_Murphy".
"Farva" is befriended with: "Benny_McCabe"
"Eddie_Murphy" is befriended with: "Sam_Jingles", "Farva".

And after a year or so, you'll be able to export the database and generate a map and see a sociographic representation of the social groups/relationships between NGG players :P.



Enjoy!

Jingles
Reply
#2

wow, that's cool, thanks for sharing REP++ for you
Reply
#3

This is really useful! Good job for originality!
Reply
#4

Very nice bro...... +1
Reply
#5

Awesome D:
Keep it up xD
Reply
#6

Nice!
Reply
#7

Nice
Reply
#8

Nice. You do not have it in SQLite?
Reply
#9

Quote:
Originally Posted by Johangelo1
View Post
Nice. You do not have it in SQLite?
you can easily convert it to sqlite its just matter of changing few lines.
Reply
#10

Wow! Nice work!
Is this applicable to any modes?
Reply
#11

Nice! +rep
Reply
#12

pass it in sqlite?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)