SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 13/08/2016, 11:36 PM   #1
Shinja
Gangsta
 
Shinja's Avatar
 
Join Date: Jan 2016
Posts: 964
Reputation: 101
Default Attachements System [MySQL Version]



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


Last edited by Shinja; 26/08/2016 at 06:25 PM.
Shinja is offline   Reply With Quote
Old 14/08/2016, 12:00 AM   #2
DeksoN
Little Clucker
 
Join Date: Dec 2014
Posts: 29
Reputation: 0
Default Re: Attachements System [MySQL Version]

Good script 10+!
Gonna test it !
DeksoN is offline   Reply With Quote
Old 14/08/2016, 03:07 PM   #3
SyS
High-roller
 
SyS's Avatar
 
Join Date: Oct 2015
Posts: 1,948
Reputation: 504
Default Re: Attachements System [MySQL Version]

Good work
SyS is offline   Reply With Quote
Old 14/08/2016, 04:42 PM   #4
Shinja
Gangsta
 
Shinja's Avatar
 
Join Date: Jan 2016
Posts: 964
Reputation: 101
Default Re: Attachements System [MySQL Version]

Thanks
Shinja is offline   Reply With Quote
Old 14/08/2016, 09:16 PM   #5
Fantje
Huge Clucker
 
Join Date: Dec 2014
Posts: 393
Reputation: 9
Default Re: Attachements System [MySQL Version]

I love it wow
__________________
Fantje is offline   Reply With Quote
Old 14/08/2016, 10:07 PM   #6
Vince
Spam Machine
 
Vince's Avatar
 
Join Date: Sep 2007
Location: Belgium
Posts: 10,089
Reputation: 2655
Default Re: Attachements System [MySQL Version]

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.
__________________
Vince is offline   Reply With Quote
Old 14/08/2016, 10:40 PM   #7
Shinja
Gangsta
 
Shinja's Avatar
 
Join Date: Jan 2016
Posts: 964
Reputation: 101
Default Re: Attachements System [MySQL Version]

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!

Last edited by Shinja; 14/08/2016 at 11:27 PM.
Shinja is offline   Reply With Quote
Old 26/08/2016, 05:22 PM   #8
justjamie
Huge Clucker
 
Join Date: May 2014
Posts: 424
Reputation: 5
Default Re: Attachements System [MySQL Version]

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)
justjamie is offline   Reply With Quote
Old 26/08/2016, 05:39 PM   #9
Shinja
Gangsta
 
Shinja's Avatar
 
Join Date: Jan 2016
Posts: 964
Reputation: 101
Default Re: Attachements System [MySQL Version]

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?
Shinja is offline   Reply With Quote
Old 26/08/2016, 05:42 PM   #10
justjamie
Huge Clucker
 
Join Date: May 2014
Posts: 424
Reputation: 5
Default Re: Attachements System [MySQL Version]

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?
justjamie 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
[FilterScript] [FilterScript] [FS] [MySQL] [DINI] Anti Cheat System v1.3 [0.3z] [New version] Max_Andolini Filterscripts 53 26/06/2018 01:06 PM
[Include] Multi-language system (MySQL version) Correlli Includes 7 18/11/2015 01:41 PM
[FilterScript] Login/Register System Mysql r8 (version cache) raddetine Filterscripts 12 15/01/2015 07:53 AM
[FilterScript] T-Admin System & MySQL [Edit Version] Team_PRO Filterscripts 11 16/12/2014 06:53 AM


All times are GMT. The time now is 01:44 AM.


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