Hi allInformation
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.
If you open the .pwn and scroll down a little, you'll see the config defines. Change them as you wish. Any questions? Just ask below, and I'll happily answer them.pawn Code://====================-- 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.
/*
Number System
1 y_ini (y_ini include by ****** 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\nLocked: %s" //This text will appear at all owned garages
#define GARAGE_FREE_TEXT "FOR SALE!\n Price: %d\n\nUse /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 garage for sale
A locked and owned garage
A unlocked and owned garage
Inside one of the garages
- Ability to lend the garage key to other players
- Ability to sell the garage to other players
- Apply the fix to prevent you from walking out/driving out of the garage, causing you to fall to death.
- None yet
Code:/creategarage | /removegarage | /garagetypes | /genter | /gexit | /lockgarage | /buygarage | /sellgarage
- streamer - By Incognito
- sscanf - By ******
- zcmd - By Zeex
- MySQL Plugin R6 - by BlueG (if using the MySQL R6 based version)
- Dini - By DracoBlue (if using the dini based system)
- y_ini- By ****** (if using the y_ini based system)
- Place the jGarage.amx in your filterscripts folder
- Create the 'garages' folder in the scriptfiles directory (Important!)
- Add 'jGarage' to the filterscripts line in your server.cfg
- Place the jGarage.amx in your filterscripts folder
- Upload the SQL dump into your MySQL database.
- Change the connection info inside the filterscript to your MySQL database connection info.
- Add 'jGarage' to the filterscripts line in your server.cfg
- V1.1 Source (.pwn) - Pastebin
- V1.1 Archive (.rar) - Download from jstylezzz.com
- V1.1 SQL dump for the MySQL version - jstylezzz.com
- V1.0b - Pastebin
- V1.0b - Archive on jstylezzz.com
- V1.0b strcmp commands - Pastebin
- V1.0b - Pastebin
- V1.0b strcmp commands - Pastebin
- V1.0b SQL Dump - jstylezzz.com
Looks nice man! I can see you've put a lot of effort into this. I'll be sure to check it out
![]() |
Dini is the only thing I don't like about this, but as you said, you could create a y_ini and mysql version aswell...
Looking good, I think many people could use this. |
Looks pretty good, bro! But does it just use the one interior? Or will there be multiples to choose from?
|
Looks awesome, had this idea like a year ago, never made it though!
Great job man, +rep for the idea, will script my own for my server though (as I'd like to import it to the house system). Great job, once again ![]() |
Do it work with R35 plugin ? (mysql)
https://sampforum.blast.hk/showthread.php?tid=56564 |
Hi this system works great. Although I have one issue. I can play and use the garage system over and over again, I can reset the server using gmx 5 or 6 times. But after the server has been reset quite a few times, the pickups and 3d text for the garages appear, but when you type /genter near them, nothing happens... Does anyone know a solution to this?
I created a /mygarages command to try and find out what the issue is and it says that I own garageUID 0, when actually I own UID 5. Thanks in advance |
SendRconCommand("unloadfs jGarage");
SendRconCommand("loadfs jGarage");