(574 downloads | 1439 views)
I received some requests for a dynamic garage system, using Dini to save files. After some time of work, I finished it. Now, I know Dini is not the most used and most advanced file processor out here, but as I specifically got asked to use Dini, I used it. Since 5/12/14 there's a universal script available, holding a dini, y_ini, MySQL and SQLite version. It also has 'strcmp command' mode and 'zcmd' mode.
Basically, this script let's you create garages for players to store their vehicles in. Each garage has it's own virtualworld, which means they won't see eachother in different garages. As Rcon, you can create and remove garages. As normal player, you're able to buy a garage, sell your garage, lock it, and store your vehicles in it.
Note: This script does not save vehicles. You'll need a vehicle system which saves the virtualworld and interior of the car, otherwise it won't load properly.
//====================-- SCRIPT CONFIGURATION --=====================================//
#define COMMAND_SYS 1 //Set to '1' for zcmd, change to '2' for strcmp
#define SAVING_SYS 4//Change this to the number of the saving system you want.
1 y_ini (y_ini include by Y_Less needed)
2 Dini (Dini include by Dracoblue needed)
3 MySQL R6 !unthreaded! (MySQL plugin/include by BlueG needed, R6, unthreaded queries)
4 SQLite (sampdb include by the SA-MP Team needed)
//-- SYSTEMATIC CONFIGURATION --//
#define MAX_OWNED_GARAGES 5 //Set this to the max. number of garages that a player should be able to own
#define AUTOSAVE true //Set to false if you don't want the script to autosave
#define AUTOSAVE_INTERVAL 10 //Set this to the amount of <~!~> MINUTES <~!~> you want the autosave function to be called (if enabled)
#define MAX_GARAGES 100 //Max garages to be created in the server
//-- PICKUPS AND TEXTLABELS --//
#define GARAGE_OWNED_PICKUP 1559 //Change this to the pickup model you prefer. Default: White arrow (diamond)
#define GARAGE_FREE_PICKUP 1273 //Change this to the pickup model you prefer. Default: Green house
#define GARAGE_OWNED_TEXT "Owner: %s
Locked: %s" //This text will appear at all owned garages
#define GARAGE_FREE_TEXT "FOR SALE!
Use /buygarage to buy this garage." //This text will appear at all garages that are for sale
#define DD 200.0 //The streamdistance for the textlabels
//-- COLORS --//
#define TXTCOLOR 0xF9C50FFF //The textcolor for the textlabels
#define COLOR_USAGE 0xBB4D4DFF //The textcolor for the 'command usage' message
#define COLOR_SUCCESS 0x00AE00FF //The textcolor for the 'command sucessfull' message
#define COLOR_ERROR 0xFF0000FF //The textcolor for the 'error' message
#define COLOR_ORANGE 0xFFA500FF //The color orange
#define COLOR_LIGHTBLUE 0xADD8E6FF //The color light blue
////-- MySQL database/connection info. Only needed when using saving system number 3, MySQL. You can ignore this otherwise --////
#define HOST "localhost"
#define USER "root"
#define PASS ""
#define DataB "SAMP"
As you will see in the source code, I put some comments after code, to give you a better idea of what I'm doing. Again, if anything is unclear, ask here :)
There's not much to show actually, but here are some screenshots anyways.
A locked and owned garage
A unlocked and owned garage
Inside one of the garages
/creategarage | /removegarage | /garagetypes | /genter | /gexit | /lockgarage | /buygarage | /sellgarage
You are NOT allowed to re-upload or re-release this without my WRITTEN permission! Also don't claim it as your own, respect the author's work. As for the rest, you may use and modify this script as much as you wish, just leave the credits where they are.
Ps. If I forgot to mention anything in this thread, please tell me!