SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 16/01/2014, 10:19 AM   #1
Jstylezzz
High-roller
 
Jstylezzz's Avatar
 
Join Date: Sep 2011
Location: Netherlands
Posts: 1,836
Reputation: 1550
Default jGarage - Dynamic garages

jGarage - Dynamic garages
by Jstylezzz


Introduction

  • Why this script?
Hi all
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.
Information

  • Things you can configure
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"
//
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.

  • Script comments

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

  • Screenshots

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


  • Things for the next update:
  • 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.

  • Reported bugs
  • None yet

  • Available commands

Code:
/creategarage | /removegarage | /garagetypes | /genter | /gexit | /lockgarage | /buygarage | /sellgarage


  • Requirements


Installation
  • Version 1.1 and above

    1. Place jGarage.amx in your filterscripts folder
    2. Extract the scriptfiles folder from the archive. It contains the required folders, and the database file for the SQLite data.
    3. Add jGarage to the filterscripts line in your server.cfg (Note: it's cAsE SensiTive!)
    4. If you use the MySQL system, be sure to add the plugin to the plugins line.
    5. The default saving system is SQLite. If you want to use another saving system, open up the .pwn and check the systematic configuration section.
    6. If you're using the MySQL R6 version, be sure to upload the SQL dump to your database.


  • Version 1.0b

    • Dini version
    1. Place the jGarage.amx in your filterscripts folder
    2. Create the 'garages' folder in the scriptfiles directory (Important!)
    3. Add 'jGarage' to the filterscripts line in your server.cfg
    • Non-threaded MySQL version
    1. Place the jGarage.amx in your filterscripts folder
    2. Upload the SQL dump into your MySQL database.
    3. Change the connection info inside the filterscript to your MySQL database connection info.
    4. Add 'jGarage' to the filterscripts line in your server.cfg




Downloads


License

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.
Thanks!




Ps. If I forgot to mention anything in this thread, please tell me!

Last edited by Jstylezzz; 10/08/2014 at 11:45 AM.
Jstylezzz is offline   Reply With Quote
Old 16/01/2014, 11:00 AM   #2
Zjiht
Little Clucker
 
Join Date: Sep 2011
Posts: 12
Reputation: 10
Default Re: jGarage - Dynamic garages

Looks nice man! I can see you've put a lot of effort into this. I'll be sure to check it out
__________________
Zjiht is offline   Reply With Quote
Old 16/01/2014, 11:09 AM   #3
Baboon
Banned
 
Join Date: Nov 2010
Location: The Netherlands
Posts: 920
Reputation: 348
Default Re: jGarage - Dynamic garages

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.
Baboon is offline   Reply With Quote
Old 16/01/2014, 03:12 PM   #4
Jstylezzz
High-roller
 
Jstylezzz's Avatar
 
Join Date: Sep 2011
Location: Netherlands
Posts: 1,836
Reputation: 1550
Default Re: jGarage - Dynamic garages

Quote:
Originally Posted by Zjiht View Post
Looks nice man! I can see you've put a lot of effort into this. I'll be sure to check it out
Quote:
Originally Posted by Strawhats View Post
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.
Thanks guys. I do realize Dini is the turn-off here, and my idea is to get a MySQL version up soon. (Threaded and Non-Threaded, 2 versions).
Jstylezzz is offline   Reply With Quote
Old 16/01/2014, 06:06 PM   #5
justsomeguy
High-roller
 
justsomeguy's Avatar
 
Join Date: Apr 2010
Location: At rBn's fissa
Posts: 2,481
Reputation: 1976
Default Re: jGarage - Dynamic garages

Looks pretty good, bro! But does it just use the one interior? Or will there be multiples to choose from?
__________________
Mooi verhaal, man.
justsomeguy is offline   Reply With Quote
Old 16/01/2014, 06:22 PM   #6
Jstylezzz
High-roller
 
Jstylezzz's Avatar
 
Join Date: Sep 2011
Location: Netherlands
Posts: 1,836
Reputation: 1550
Default Re: jGarage - Dynamic garages

Quote:
Originally Posted by justsomeguy View Post
Looks pretty good, bro! But does it just use the one interior? Or will there be multiples to choose from?
Thanks There are multiple interiors. In the script there's an array containing coordinates that lead to an interior. At this moment there are 3 interiors to choose from; 1. Small garage, 2. Medium garage, and 3. Big garage.
People can add their own if they have mapped garages for example.

Update

  • Made a non-threaded MySQL version, using BlueG's R6 plugin.

Check the main thread for the download and on how to install.
Jstylezzz is offline   Reply With Quote
Old 16/01/2014, 06:27 PM   #7
Wayland
Big Clucker
 
Wayland's Avatar
 
Join Date: Sep 2013
Location: Endonesyah
Posts: 55
Reputation: 2
Default Re: jGarage - Dynamic garages

This is awesome man. Rep+
__________________
Server: 213.57.186.228:7777

Wayland is offline   Reply With Quote
Old 18/01/2014, 05:42 PM   #8
ivanorezac
Little Clucker
 
ivanorezac's Avatar
 
Join Date: Feb 2010
Posts: 34
Reputation: 0
Default Re: jGarage - Dynamic garages

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
ivanorezac is offline   Reply With Quote
Old 18/01/2014, 06:45 PM   #9
anou1
Huge Clucker
 
Join Date: Dec 2013
Location: To infinity... and beyond
Posts: 417
Reputation: 31
Default Re : jGarage - Dynamic garages

Can a car enter in it ?
anou1 is offline   Reply With Quote
Old 18/01/2014, 06:49 PM   #10
Jstylezzz
High-roller
 
Jstylezzz's Avatar
 
Join Date: Sep 2011
Location: Netherlands
Posts: 1,836
Reputation: 1550
Default Re: jGarage - Dynamic garages

Quote:
Originally Posted by Wayland View Post
This is awesome man. Rep+
Quote:
Originally Posted by ivanorezac View Post
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
Thanks

Quote:
Originally Posted by anou1 View Post
Can a car enter in it ?

Yes. If you're standing on the pickup while in a car, you and the car will be teleported inside.
Jstylezzz 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
Save dynamic garages Zombie18256 Scripting Help 5 09/01/2014 01:16 AM
Business and Garages FaZeRs Scripting Help 3 06/02/2013 02:52 PM
Gate/garages nickstar Scripting Help 0 04/01/2013 08:53 PM
Disable garages Diorturato Scripting Help 4 28/12/2012 04:49 PM
Garages not loading? rep RLGaming Scripting Help 3 13/10/2012 06:57 PM


All times are GMT. The time now is 10:24 AM.


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