SA-MP Forums Archive
[FilterScript] Attachements System [MySQL Version] - 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] Attachements System [MySQL Version] (/showthread.php?tid=614852)

Pages: 1 2


Attachements System [MySQL Version] - Shinja - 13.08.2016


Attachements System [MySQL Version]
This FilterScript allows player to add Attachement (also known as Toys, Clothes...) withtin the limit set in the script. Command: /OBJECTS (can be changed easily)
NOTE: *Maximum possible is 10!
The data is saved using MySQL in a table that creates automatically when you load the filterscript and start the server, and you don't have to worry about saving on Disconnect, Timers( ), Everywhen the player Adds or Edits an Attachement, it will be saved!

IMPORTANT: *You must be connecting to a MySQL database in the gamemode
*You must have a Users/Playerbase table that contains a field ID that can't be same for 2 players and never change, mostly like ID to Load/Save properly.
*This FilterScript uses MySQL R33 and above (39R-5 Recommended, download in Requirements)
*You must be connecting to a MySQL database in the gamemode

REQUIREMENTS: Download Full Package

PICTURES:






INSTALLING:
Must change:
PHP Code:
//===========CHANGES===========//
#define MYSQL_USERS_TABLE "Users"
#define MYSQL_ID_FIELDNAME "ID"
#define MYSQL_ID_INDEX 0 //It's mostly like always 0, but depends on your table!
//=============================// 
For custom settings:
PHP Code:
//=======CUSTOM SETTINGS=======//
#undef MAX_OBJECTS
#define MAX_OBJECTS 5
#define MINX 0.25
#define MINY 0.25
#define MINZ 0.25
#define MAXX 3.00
#define MAXY 3.00
#define MAXZ 3.00
//=============================// 
Compile, and Load the filterscript!

PASTBIN:
NEW VERSION




Re: Attachements System [MySQL Version] - DeksoN - 13.08.2016

Good script 10+!
Gonna test it !


Re: Attachements System [MySQL Version] - SyS - 14.08.2016

Good work


Re: Attachements System [MySQL Version] - Shinja - 14.08.2016

Thanks


Re: Attachements System [MySQL Version] - Fantje - 14.08.2016

I love it wow


Re: Attachements System [MySQL Version] - Vince - 14.08.2016

Seems okay. Lots of unnecessary repetition in OnDialogResponse, though. inindex[playerid] = listitem. And slot = listitem + 1. So the dialog title and message merely need to be formatted with that number.


Re: Attachements System [MySQL Version] - Shinja - 14.08.2016

Thanks!

Quote:
Originally Posted by Vince
View Post
Seems okay. Lots of unnecessary repetition in OnDialogResponse, though. inindex[playerid] = listitem. And slot = listitem + 1. So the dialog title and message merely need to be formatted with that number.
Got it! Fixed everything (-60 Lines)
I appreciate your time checking whole code

Optimized some loops.
Updated!


Re: Attachements System [MySQL Version] - justjamie - 26.08.2016

i got some issues, it doesn't send the querys for me, why is that?
it shows this:
[18:11:51] [DEBUG] mysql_tquery - connection: 0, query: "", callback: "LoadPlayerID", format: "i"
[18:11:51] [ERROR] mysql_tquery - invalid connection handle (id: 0)


Re: Attachements System [MySQL Version] - Shinja - 26.08.2016

Quote:
Originally Posted by justjamie
View Post
i got some issues, it doesn't send the querys for me, why is that?
it shows this:
[18:11:51] [DEBUG] mysql_tquery - connection: 0, query: "", callback: "LoadPlayerID", format: "i"
[18:11:51] [ERROR] mysql_tquery - invalid connection handle (id: 0)
Do you have only 1 connectionHandle?


Re: Attachements System [MySQL Version] - justjamie - 26.08.2016

Quote:
Originally Posted by Shinja
View Post
Do you have only 1 connectionHandle?
yes i do

do you have skype or something, that you can maybe look at what i did wrong?


Re: Attachements System [MySQL Version] - Shinja - 26.08.2016


FIXES26/08/2016
Fix *invalid connection handle (0) will no longer occur if you connecting to ONLY 1 database
Thanks to justjamie for Reporting!






Re: Attachements System [MySQL Version] - Kwarde - 26.08.2016

Why are you using MySQL and not SQLite?


Re: Attachements System [MySQL Version] - Shinja - 26.08.2016

Quote:
Originally Posted by Kwarde
Посмотреть сообщение
Why are you using MySQL and not SQLite?
Lol? i really don't understand why asking this


Re: Attachements System [MySQL Version] - Kwarde - 26.08.2016

Because I don't see why you should use MySQL. It's not like I want to synchronise this information with any website and I can't imagine anyone would. SQLite is faster than MySQL. Here on SA:MP, alot of people use MySQL when they could just simply use the built-in SQLite. Now if I want to use this script I have to add an extra plugin, I have to setup a MySQL server; so more data traffic blabla.
Perhaps if you have a few hundreds people at once using this system MySQL then might be faster (which I doubt). In that case it would be handy if you added an option to choose between SQLite and MySQL (using #if defined's)


Re: Attachements System [MySQL Version] - Shinja - 27.08.2016

Quote:
Originally Posted by Kwarde
Посмотреть сообщение
Because I don't see why you should use MySQL. It's not like I want to synchronise this information with any website and I can't imagine anyone would. SQLite is faster than MySQL. Here on SA:MP, alot of people use MySQL when they could just simply use the built-in SQLite. Now if I want to use this script I have to add an extra plugin, I have to setup a MySQL server; so more data traffic blabla.
Perhaps if you have a few hundreds people at once using this system MySQL then might be faster (which I doubt). In that case it would be handy if you added an option to choose between SQLite and MySQL (using #if defined's)
I understand, you right, as your right also in "Here on SA:MP, alot of people use MySQL when they could", but i like the idea to choose between. However thanks for you time.


Re: Attachements System [MySQL Version] - WhiteGhost - 27.08.2016

Quote:
Originally Posted by Kwarde
Посмотреть сообщение
Because I don't see why you should use MySQL. It's not like I want to synchronise this information with any website and I can't imagine anyone would. SQLite is faster than MySQL. Here on SA:MP, alot of people use MySQL when they could just simply use the built-in SQLite. Now if I want to use this script I have to add an extra plugin, I have to setup a MySQL server; so more data traffic blabla.
Perhaps if you have a few hundreds people at once using this system MySQL then might be faster (which I doubt). In that case it would be handy if you added an option to choose between SQLite and MySQL (using #if defined's)
You're absolutely right. but everyone is saying mysql is better which i did some research the truth is none is, there both SQL it's what you're using it for and in this case its for samp so yes SQLite is much faster/better but everyone is going with mysql and pefer mysql


Re: Attachements System [MySQL Version] - SickAttack - 27.08.2016

Quote:
Originally Posted by WhiteGhost
Посмотреть сообщение
You're absolutely right. but everyone is saying mysql is better which i did some research the truth is none is, there both SQL it's what you're using it for and in this case its for samp so yes SQLite is much faster/better but everyone is going with mysql and pefer mysql
Both SQLite and MySQL are pretty much the same, people instantly go with MySQL because there are heaps of threads about them (asking for help and so on - gets the word out), and because they plan to add a UCP and think that's the only way it can be done, or because they want to make things simple. Or because of the threaded version, but they're pretty much the same in regards to performance.

It doesn't really matter which one you choose to use. You can use the socket plugin for a UCP, or any other way you would want to achieve that.


Re: Attachements System [MySQL Version] - WhiteGhost - 27.08.2016

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
Both SQLite and MySQL are pretty much the same, people instantly go with MySQL because there are heaps of threads about them (asking for help and so on - gets the word out), and because they plan to add a UCP and think that's the only way it can be done, or because they want to make things simple. Or because of the threaded version, but they're pretty much the same in regards to performance.

It doesn't really matter which one you choose to use. You can use the socket plugin for a UCP, or any other way you would want to achieve that.
Honestly i like SQLite its better in my opinion,but i've heard when theres alot of registered accounts it gets slow is that true?


Re: Attachements System [MySQL Version] - tboysamp - 01.09.2016

I'm having a few problems understanding on how to set this up where exactly do I get the information so I can connect it to the database


Re: Attachements System [MySQL Version] - Shinja - 01.09.2016

Just change this part to your info
Quote:
INSTALLING:
Must change:
PHP код:
//===========CHANGES===========//
#define MYSQL_USERS_TABLE "Users"
#define MYSQL_ID_FIELDNAME "ID"
#define MYSQL_NAME_FIELDNAME "Name"
#define MYSQL_ID_INDEX 0
//=============================//