Jump to content

[REL] Car Dealership


ViRuZGamiing

Recommended Posts

Posted (edited)

Hey Guys

So I decided to rewrite this entire post because it was lacking a bit of information and formatting.
 

Information

First, the new version (4.1) requires my new script called simple-notifications which I made specific for this script to have some notifications.
Inside the resource folder you will find a file called data.xml this file contains all the information on the garages/car dealerships.

Youtube Preview
https://www.youtube.com/watch?v=N_AaE4ZSfHc

XML Structure

<data>
    <garage x="-2068.6442871094" y="49.485717773438" z="28" width="51.8923339844" depth="48.108177185058" height="10">
        <blip x="-2038.0665283203" y="82.775970458984" z="42" icon="55" size="2" r="255" g="0" b="0" a="255" ordering="0" distance="200" />
        <spawnpoints>
            <spawnpoint name="spawn1" x="-2049.8791503906" y="56.531303405762" z="27.985414505005" rx="0" ry="0" rz="270" />
        </spawnpoints>
        <vehicles>
            <vehicle name="Alpha" model="602" x="-2022.8159179688" y="84.669151306152" z="28" rx="0" ry="0" rz="270" price="1000" spawnpoint="spawn1" />
        </vehicles>
    </garage>
</data>

This explanation will require a basic understanding of XML.

- garage: Cuboid zone that handles all cars inside
  x: The X position of the garage's western side
  y: The Y position of the garage's southern side
  z: The Z position of the garage's lowest side
  width: The garage's width
  depth: The garage's depth
  height: The garage's height

    - blip: this should be self explanatory (createBlip)
    - spawnpoints: list of spawnpoints with name, minimum 1 required
    	- spawnpoint: spawnpoint information
          name: required name can be anything
          x, y, z: Position coordinates
          rx, ry, rz: Rotation coordinates
    - vehicles: list of all the vehicles in the store
    	- vehicle: vehicle information
          name: Display name for the UI elements
          model: modelID,
          x, y, z: Position coordinates
          rx, ry, rz: Rotation coordinates
          price: price
          spawnpoint: name of the spawnpoint (can be left out, first spawnpoint in list will be used)

Requirements

simple-notifications (separate script by me)

• min client version of 1.5.6-9.14370

Download

https://community.multitheftauto.com/index.php?p=resources&s=details&id=8406

 

Quote

Special thanks to:

• IIYAMA for getting me into programming

• Bandi94 helped me in the first versions on how to get started with dxDraw

• Castillo's suggestion for using an XML

 

Edited by ViRuZGamiing
added link to youtube video
Posted
Maybe for the next version, you should make the vehicles on a XML file or a table, it would be a lot easier to add/remove vehicles.

Great idea BUT i don't have any idea how to connect a Lua with an XML File. (exept of Meta)

Posted
Maybe for the next version, you should make the vehicles on a XML file or a table, it would be a lot easier to add/remove vehicles.

Great idea BUT i don't have any idea how to connect a Lua with an XML File. (exept of Meta)

A table would work just as good.

Posted

UPDATED!

Huge thanks to IIYAMA who learned me scripting and especial the Tables.

• Added Blip till 200m visible

• Added Table to add Vehicles, Vehicles spawnpoints and Prices

  • 5 months later...
Posted

Nice one and i agree with Solidsnake, making the vehicles on xml file is the easist to edit/add vehicles and some suggestions:

- a GUI for players to spawn/hide the vehicles and saved to the account

- Ability to sell the cars the players bought for the half of the price

- Make multiple shops that contain different kind of vehicles (e.g aircraft, bikes, cars..etc)

I hope you add those in the future verison :) good luck

Posted

Thx for the suggestion i'll try and learn some new stuff to improve it like you said.

XML would be easier but it's hard to learn. Adding multiple shops is already possible in the code but i'll put some new ones in.

I'll keep you updated!

  • 2 months later...
  • 2 months later...
Posted
It would be good if you made it so u can edit the cars in the shop ingame

It's updated, I've made it so u can edit vehicles and prices ingame, later on i'll try and make it a dropdown list instead of a edit field where u need to know the id's.

regards ViRuZ

  • 2 weeks later...
  • 3 weeks later...
Posted

Thats very nice.. but if you add the ability to spawn/hide the cars you buy whenever you want with SQLite database it will be awesome

Posted
Thats very nice.. but if you add the ability to spawn/hide the cars you buy whenever you want with SQLite database it will be awesome

Yes, I'm aware of it, many players request SQL and it's something great I can use except I need to learn it first.

  • 5 years later...
Posted

Hi guys

After 6 years I've decided to rewrite my script and improve on it as well ?

Changelog
• removed GUI Control Panel
• removed dxDraw messages
• Dynamic XML File to add as many car dealerships as you want
• A lot of bug fixes and code optimizations (I was ashamed of looking my code)

Roadmap (if I get to it)
• Add new UI (GUI/dxDraw) elements
• Add a new control panel

Example of the XML File

spacer.png

  • Like 1
  • 2 weeks later...
Posted

Appears it's still addicting to write resources for MTA:SA after all that time haha, new update ?

Changelog 4.1
• Added new UI elements (requires simple-notifications resource)
• Minimum client version of 1.5.6-9.14370

• Forum post is also reworked and new YouTube video has been added

  • Moderators
Posted

A blast from the past indeed! It's great to see old projects being continued.

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...