SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts

Reply
 
Thread Tools Display Modes
Old 18/03/2015, 12:54 PM   #1
Jingles
Little Clucker
 
Join Date: May 2013
Posts: 28
Reputation: 73
Default [MySQL] Friend System

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
Attached Files
File Type: zip [MySQL] SA-MP Friend System - By Jingles.zip (4.0 KB, 735 views)
__________________
--------
Somewhere over the rainbow!
Jingles is offline   Reply With Quote
Old 18/03/2015, 01:09 PM   #2
Mya
Banned
 
Join Date: Mar 2015
Location: In Here
Posts: 73
Reputation: 11
Default Re: [MySQL] Friend System

wow, that's cool, thanks for sharing REP++ for you
Mya is offline   Reply With Quote
Old 19/03/2015, 02:15 PM   #3
kampuman
Big Clucker
 
kampuman's Avatar
 
Join Date: Dec 2014
Location: Galaxy
Posts: 63
Reputation: 0
Default Re: [MySQL] Friend System

This is really useful! Good job for originality!
kampuman is offline   Reply With Quote
Old 19/03/2015, 03:17 PM   #4
hamzajaved780
Big Clucker
 
hamzajaved780's Avatar
 
Join Date: Jan 2015
Location: Karachi
Posts: 145
Reputation: 14
Default Re: [MySQL] Friend System

Very nice bro...... +1
__________________
hamzajaved780 is offline   Reply With Quote
Old 19/03/2015, 04:19 PM   #5
Younes44
Gangsta
 
Younes44's Avatar
 
Join Date: Oct 2013
Posts: 766
Reputation: 78
Default Re: [MySQL] Friend System

Awesome D:
Keep it up xD
__________________
Left SA:MP, and not avalaible anymore!!
Thanks samp for awesome moments, i enjoy!! Goodbye!
ModernFreeroam: www.mf-samp.com , IP:94.23.255.30:7777
CounterTerroristUnit: www.ctu.w4f.eu , IP:87.98.243.201:6969
xSF: www.xsfserver.com , IP: 87.98.243.201:6969
Exm: www.exmserv.me , IP: exmserv.me:7777
Underground Stunting: www.ustunting.com , IP:145.239.3.225:7777

Thanks everyone,for the awesome moments,
Regards, COD Ghosts owner.
Younes44 ,YOuNeS_Dz ,WarZ ,Bryan_ , Kaneki
Younes44 is offline   Reply With Quote
Old 21/03/2015, 01:58 AM   #6
AchievementMaster360
Huge Clucker
 
AchievementMaster360's Avatar
 
Join Date: Apr 2012
Location: New York, United States
Posts: 233
Reputation: 24
Default Re: [MySQL] Friend System

Nice!
AchievementMaster360 is offline   Reply With Quote
Old 22/03/2015, 08:06 AM   #7
TonyCan
Little Clucker
 
Join Date: Jul 2014
Posts: 7
Reputation: 0
Default Re: [MySQL] Friend System

Nice
TonyCan is offline   Reply With Quote
Old 16/03/2017, 01:18 AM   #8
Johangelo1
Banned
 
Join Date: Mar 2016
Posts: 129
Reputation: 15
Default Respuesta: [MySQL] Friend System

Nice. You do not have it in SQLite?
Johangelo1 is offline   Reply With Quote
Old 16/03/2017, 01:25 AM   #9
SyS
High-roller
 
SyS's Avatar
 
Join Date: Oct 2015
Posts: 1,951
Reputation: 500
Default Re: Respuesta: [MySQL] Friend System

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.
SyS is offline   Reply With Quote
Old 16/03/2017, 11:02 AM   #10
Rodzknot
Little Clucker
 
Join Date: May 2016
Posts: 6
Reputation: 0
Default Re: [MySQL] Friend System

Wow! Nice work!
Is this applicable to any modes?
Rodzknot is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Tutorial] [VIDEO] MySQL ORM r38: How to pair GM with MySQL & creation of registration/connection system cArnasLT Tutorials 3 19/05/2014 02:08 PM
[Script request]Anims for MYSQL and Business system for mysql Doros Scripting Help 1 13/12/2013 11:03 AM
[FilterScript] Simple Friend System Shelby Filterscripts 7 04/10/2011 04:49 PM
[FilterScript] Simple Friend System Lós Lançamentos/Releases 15 04/10/2011 01:28 PM
HELP.. "Friend" system.. Faith Help Archive 17 06/08/2010 11:20 PM


All times are GMT. The time now is 02:42 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.