SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 02/10/2016, 03:38 PM   #1
Konstantinos
Spam Machine
 
Konstantinos's Avatar
 
Join Date: Dec 2011
Posts: 11,984
Reputation: 1392
Default Tune System

Tune System



It is a simple yet effective filterscript designed for Freeroam (soon for Roleplay as well, prices will be added) servers which allows you to tune a vehicle outside of mod shops. It currently does not support Nitro or Stereo and probably never will.

There are only 4 commands available at the moment which are:
  • /paintjob - Shows a list with the available paintjobs supported for a specific vehicle and an option to unset (remove) the paintjob.
  • /tune - Shows a list with all the available categories of components.
  • /vcolor - Allows you to change the colors of your vehicle!
  • /vcolorlist - Shows a list with all the available vehicle colors (both the existing colors from San Andreas and extended colors were added in 0.3x).


How to install:

MySQL:
  • Import the .sql file to your database.
  • Find the version (R33 to R39-6 or R40+) that matches the plugin version you've loaded into your server. Change the mysql configuration and save (compile) the filterscript as tune_system.pwn
  • Open server.cfg and add tune_system in the filterscripts line.

SQLite:
  • Import the .sql file to your database or paste tune_system.db into scriptfiles folder.
  • Change the configuration (database name) if you import the .sql file to a different database name.
  • Save (compile) the filterscript as tune_system.pwn
  • Open server.cfg and add tune_system in the filterscripts line.


Important notes:
  • It requires a vehicle spawner system at the very least.
  • If the connection to the mysql server fails or the .db file (SQLite) couldn't be opened, it will try to unload the filterscript.
    Make sure the filterscript is named as tune_system.

  • MySQL:
    • Create a different database if you can. Using the same server and database will result in duplicate connections. You can allow them using:
      Code:
      mysql_option(DUPLICATE_CONNECTIONS, true);
      for R33 to R39-6 versions or:
      Code:
      mysql_global_options(DUPLICATE_CONNECTIONS, true);
      for R40+ versions of the mysql plugin. If you want to use only one connection for filterscripts and the gamemode (in R40+ versions), you'll need to disable DUPLICATE_CONNECTION_WARNING:
      Code:
      mysql_global_options(DUPLICATE_CONNECTION_WARNING, false);
    • In case you get an error while trying to import the .sql file:
      PHP Code:
      Error

      SQL query
      :

      /*!40101 SET NAMES utf8mb4 */;

      MySQL saidDocumentation
      #1115 - Unknown character set: 'utf8mb4' 
      indicates that you use an older version of the mysql server. It is always recommended to update but if you cannot/don't want to, replace character set as 'utf8'.


Downloads:
You can find the main repository here: https://github.com/Konstantinos-Sk/tune-system

MySQL:
R33 to R39-6 version: https://raw.githubusercontent.com/Ko...une_system.pwn
R40+ version: https://raw.githubusercontent.com/Ko...une_system.pwn
The .sql file to import: https://raw.githubusercontent.com/Ko...une_system.sql

SQLite:
The filterscript can be found here: https://raw.githubusercontent.com/Ko...une_system.pwn
The .sql file to import: https://raw.githubusercontent.com/Ko...une_system.sql
A created database file if you don't want to import: https://github.com/Konstantinos-Sk/t...em.db?raw=true


Gallery: http://imgur.com/a/IaZ1z


Credits
  • BlueG & maddinat0r (MySQL plugin)
  • Y_Less, Emmet_ & maddinat0r (sscanf plugin)
  • Zeex (zcmd)
  • iJumbo (Color list idea - it was based on one of his post in Useful Snippets thread)
  • oMa37 (testing)
__________________
Life is like riding a bicycle. To keep your balance, you must keep moving.

[Tutorial] How to use SQLite
[FilterScript] Tune System

Last edited by Konstantinos; 04/10/2016 at 03:54 PM.
Konstantinos is offline   Reply With Quote
Old 02/10/2016, 03:38 PM   #2
SyS
High-roller
 
SyS's Avatar
 
Join Date: Oct 2015
Posts: 1,975
Reputation: 451
Default Re: Tune System

I was waiting for your release
SyS is offline   Reply With Quote
Old 02/10/2016, 03:41 PM   #3
Jonggol
Little Clucker
 
Jonggol's Avatar
 
Join Date: Nov 2014
Location: Batam, Indonesia
Posts: 29
Reputation: 3
Default Re: Tune System

First release for filterscript for this forum, and this is great!
Jonggol is offline   Reply With Quote
Old 02/10/2016, 03:43 PM   #4
oMa37
High-roller
 
oMa37's Avatar
 
Join Date: Feb 2016
Posts: 1,016
Reputation: 155
Default Re: Tune System

Good job!
oMa37 is offline   Reply With Quote
Old 03/10/2016, 09:13 AM   #5
Konstantinos
Spam Machine
 
Konstantinos's Avatar
 
Join Date: Dec 2011
Posts: 11,984
Reputation: 1392
Default Re: Tune System

I managed to find a way to extract the data and re-calculate them so it will be sorted by the index of the enum and get rid of ORDER BY CAST.

Both the filterscript and the .sql file have been updated.

Quote:
Originally Posted by Sreyas View Post
I was waiting for your release
I wasn't planning to release it as standalone but include it in the gamemode (yeah, that racing system one which will probably released in the next year). Hopefully, I changed my mind.

Quote:
Originally Posted by Jonggol View Post
First release for filterscript for this forum, and this is great!
Quote:
Originally Posted by oMa37 View Post
Good job!
Thank you!
__________________
Life is like riding a bicycle. To keep your balance, you must keep moving.

[Tutorial] How to use SQLite
[FilterScript] Tune System
Konstantinos is offline   Reply With Quote
Old 03/10/2016, 09:52 AM   #6
gurmani11
Huge Clucker
 
gurmani11's Avatar
 
Join Date: Dec 2012
Location: SKY
Posts: 358
Reputation: 18
Default Re: Tune System

As you usually help people and i consider reading your replies in "Help" section to learn something better, according to that i always had an expectation from you that you would release a stuff that has never been released.
As far as this release i saw is basic but nicely written(i emphasize on that). You should really had added some attachments thingy like neon n shit. so it could be properly used in dm racing servers.

Thanks
Keep up the good work.
gurmani11 is offline   Reply With Quote
Old 03/10/2016, 10:05 AM   #7
Konstantinos
Spam Machine
 
Konstantinos's Avatar
 
Join Date: Dec 2011
Posts: 11,984
Reputation: 1392
Default Re: Tune System

Thanks, I appreciate it! Taking advantage of MySQL and sorting only the available categories is an uncommon way than the usual method all the other similar system have used.

oMa37 suggested me the neon feature few days ago and I'm still looking for a way to use the other light objects instead of *NeonTube objects. If I don't find a way to make them look cool under the car, I'll probably add the normal method.
__________________
Life is like riding a bicycle. To keep your balance, you must keep moving.

[Tutorial] How to use SQLite
[FilterScript] Tune System
Konstantinos is offline   Reply With Quote
Old 03/10/2016, 12:20 PM   #8
PrO.GameR
Gangsta
 
PrO.GameR's Avatar
 
Join Date: Oct 2012
Posts: 733
Reputation: 121
Default Re: Tune System

This is a nice method to pull valid components for each vehicle, I'd use it in my tuning system if you give me permission to, but rather too basic to be directly used by me (RP server obviously, great for freeroam)

neat code and great idea nevertheless, good job.
__________________
Blueberry Prison Roleplay will be back soon!
Follow the forums for more information about opening day.

Forums
PrO.GameR is offline   Reply With Quote
Old 03/10/2016, 02:09 PM   #9
Bolex_
Gangsta
 
Join Date: Aug 2015
Location: Republic Of Croatia
Posts: 583
Reputation: 113
Default Re: Tune System

This is your first and it looks like you are already quite made Good Job
__________________
Bolex_ is offline   Reply With Quote
Old 03/10/2016, 03:38 PM   #10
Konstantinos
Spam Machine
 
Konstantinos's Avatar
 
Join Date: Dec 2011
Posts: 11,984
Reputation: 1392
Default Re: Tune System

I uploaded the .sql with the new table structure but with the old values before. I have updated the file once again.

About the neon feature, the other light objects are a circular light from the center of the vehicle and doesn't look that good. I think I'm going to add the neon tube objects instead. I have already written the script, the only thing left is what vehicle will support it (excluding bikes, aircraft, boats and few others).

Quote:
Originally Posted by PrO.GameR View Post
This is a nice method to pull valid components for each vehicle, I'd use it in my tuning system if you give me permission to, but rather too basic to be directly used by me (RP server obviously, great for freeroam)

neat code and great idea nevertheless, good job.
Feel free to use it in your system. I can probably write another version that includes prices for the components and paintjob if you or anybody else want to.

Quote:
Originally Posted by Scripter18 View Post
This is your first and it looks like you are already quite made Good Job
Thanks.
__________________
Life is like riding a bicycle. To keep your balance, you must keep moving.

[Tutorial] How to use SQLite
[FilterScript] Tune System
Konstantinos 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] Car tune system bartje01 Filterscripts 33 30/08/2013 12:43 PM
[FilterScript] Tune system [BP]Tony Filterscripts 17 24/05/2012 05:38 AM


All times are GMT. The time now is 07:55 PM.


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