[FilterScript] Tune System
#1

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:
      pawn Code:
      mysql_option(DUPLICATE_CONNECTIONS, true);
      for R33 to R39-6 versions or:
      pawn 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:
      pawn 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)
  • ******, Emmet_ & maddinat0r (sscanf plugin)
  • Zeex (zcmd)
  • iJumbo (Color list idea - it was based on one of his post in Useful Snippets thread)
  • oMa37 (testing)
Reply
#2

I was waiting for your release
Reply
#3

First release for filterscript for this forum, and this is great!
Reply
#4

Good job!
Reply
#5

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

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

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

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

This is your first and it looks like you are already quite made Good Job
Reply
#10

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

Good Job bro :c..
finally you release Some FS XD
Reply
#12

Woah! Awesome release.
Reply
#13

Simple yet good.Well done Konstantinos!
Reply
#14

Lovely, thanks for the effort!

+8 rep!
Reply
#15

Maybe make an SQLite version??


Nice job! +rep
Reply
#16

Thank you, everyone!

Quote:
Originally Posted by PT
Посмотреть сообщение
Maybe make an SQLite version??
SQLite does not support enums. I tried to reference another table and JOIN them but no luck, the current build should be compiled with few flags because it is very limited.

Saving as text is the only way. If I can get the bit manipulation working, I'll add SQLite version too.
Reply
#17

Nice job
Reply
#18

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Thank you, everyone!



SQLite does not support enums. I tried to reference another table and JOIN them but no luck, the current build should be compiled with few flags because it is very limited.

Saving as text is the only way. If I can get the bit manipulation working, I'll add SQLite version too.
i really hope you add the SQLite version.
Reply
#19

Few of the last updates:
  • SQLite version was added.
  • It includes a created .db file so it will be easier for use (SQLite version).
  • "Lamps" and "Front/Rear Bullbar" were renamed to "Lights" and "Front/Rear Bullbars" respectively.
  • Indexes were added to tables structure to both MySQL and SQLite .sql files.
---

I'm planning to add two more versions that will basically be the initial version with an extra feature:
  1. neon
  2. prices (suitable for RP servers)
The next update will take a bit longer since University starts this week and there are more files to update for both MySQL and SQLite versions (plus the .sql files).
Reply
#20

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Few of the last updates:
  • SQLite version was added.
  • It includes a created .db file so it will be easier for use (SQLite version).
  • "Lamps" and "Front/Rear Bullbar" were renamed to "Lights" and "Front/Rear Bullbars" respectively.
  • Indexes were added to tables structure to both MySQL and SQLite .sql files.
---

I'm planning to add two more versions that will basically be the initial version with an extra feature:
  1. neon
  2. prices (suitable for RP servers)
The next update will take a bit longer since University starts this week and there are more files to update for both MySQL and SQLite versions (plus the .sql files).
Well done

Deserved +REP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)