Jump to content

[REL] Car Dealership


ViRuZGamiing

Recommended Posts

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
Link to comment
  • 5 months later...

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

Link to comment
  • 2 months later...
  • 2 months later...
  • 2 weeks later...
  • 3 weeks later...
  • 5 years later...

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
Link to comment
  • 2 weeks later...

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