[FilterScript] Attachements System [MySQL Version]
#1


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

Reply
#2

Good script 10+!
Gonna test it !
Reply
#3

Good work
Reply
#4

Thanks
Reply
#5

I love it wow
Reply
#6

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.
Reply
#7

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!
Reply
#8

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)
Reply
#9

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?
Reply
#10

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?
Reply
#11


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



Reply
#12

Why are you using MySQL and not SQLite?
Reply
#13

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

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)
Reply
#15

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.
Reply
#16

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
Reply
#17

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.
Reply
#18

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?
Reply
#19

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
Reply
#20

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
//=============================// 

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)