Jump to content

3 Screenshots

About This File

HI all, here is a simple CarShop system, pretty optimized in client side, but not this much server-side.

 

This CarShop adapt himself to what you give it, from the config file, let me explain:

You define some parameters in the config file, for your carShop (Vehicles classses, marker position...), and the client side system with do the stuff.

Here is a example of a carShop:

"Boat": {    // Shop Name    
	"Position": { // vehicle position for the showcase, camera is auto defined from this
          "x": -729,
          "y": -1361,
          "z": 0.05,
          "rz": 136
        },
        "Marker": { // Marker for the player when entering shop
          "x": -815.93,
          "y": -1346.3,
          "z": 5.15
        },
        "Park": { // When you buy your vehicle, here is where you put vehicle location, it is random ! :D ANd a waypoint is created in client side to show where it is
          "0":{"x":-725.33,"y":-1325.299,"z":0.11,"rz":228.29},
          "1":{"x":-727.42,"y":-1329.044,"z":0.11,"rz":230.54},
          "2":{"x":-729.79,"y":-1333.469,"z":0.11,"rz":230.29},
          "3":{"x":-731.4,"y":-1332.34,"z":0.11,"rz":228.29},
          "4":{"x":-734.63,"y":-1334.34,"z":0.11,"rz":228.29},
          "5":{"x":-738.73,"y":-1342.34,"z":0.11,"rz":228.29}
        },
        "Blip": 427, // Blip for the map
        "Class": [ 14 ], // vehicle classes, see below for list
        "Name": "Boat Shop" // Displayed Name
      }

So, aswell, when connect this will create a Marker / Blip on the marker position of the config file.

And that's all for creating a car shop !

Now, you can define prices easily aswell:

In the vehicle_Shop.json file, you have the list of every vehicle which are available for selling. You have the hash, displayName, name, manufacturer & the price, define dby 15000 by default, but you can define a new price for every vehicle by yourself.

That's all you have to do, now do /carShop [YouCarShopName], and see the magic happening.

 

Here is the vehicles class name:

  1. Sedans
  2. SUVs
  3. Coupe
  4. Muscle
  5. Sport Classic
  6. Sport
  7. Super
  8. Moto
  9. Off-Road
  10. Industrial
  11. Utility
  12. Vans
  13. Cycles
  14. Boats
  15. Helicopters
  16. Planes
  17. Service
  18. Emergency
  19. Military
  20. Commercial
  21. Trains

I think i gave you all the stuff to make it works, i hope you like it!

By default you have 3 carshops, boat / low budget car/ helicopters.


What's New in Version 1.0   See changelog

Released

Add blip & Marker

  • Like 4

User Feedback

Recommended Comments

silentpain007

Posted

 

Hello,

I have a question. Unfortunately, I do not know how to add this plugin. There are 2 folders. As I know this means that what is in the folders is the folder in the server directory. Only is not yet nen folder here but only the files. Weie should I quit the folder or should I copy the files without folder in the folder?

Best regards
SilentPain

Protocole

Posted

At your directory of your server, just copy paste, client_packages & packages, and it should work.

Flow

Posted

It tells me all the time that zip is corrupted no matter how often i tried to dowload. Even other pcs. Anybody else?

Sevage

Posted

Hello,

i have this error:
ERROR in ./app/client/cVehicle.js
Module not found: Error: Can't resolve './lib/timerbars'

The directory timerbars is not exist?!

Udo_Grube

Posted

Am 30.10.2018 um 10:56 schrieb cmdflow:

It tells me all the time that zip is corrupted no matter how often i tried to dowload. Even other pcs. Anybody else?

I got the same error.

DampflokTV

Posted

Yes, the ZIP File is corrupted.

G4merElite

Posted

pasted the Folders in my Server, but it dont work. the open source rp Server is installed.

  • Like 1
Xenox

Posted

Am 20.8.2018 um 22:20 schrieb Protocole:

At your directory of your server, just copy paste, client_packages & packages, and it should work.

nope,, no funktion

CommanderDonkey

Posted

i would add this in client data, so if the user opens the menu, and click enter the error "you dont have enough money" dont show up (manually fix if user switch one car)

 

before fix:
 

    ui.IndexChange.on((index) => {
        mp.players.local.vehicleShop.model = data[Object.keys(data)[index + 1]].hash;
        mp.players.local.vehicleShop.price = data[Object.keys(data)[index + 1]].price;
    });
    ui.ItemSelect.on((item, index) => {
        mp.events.callRemote("buyVehicleShop", carShopType, JSON.stringify({ "model": mp.players.local.vehicleShop.model, "price": mp.players.local.vehicleShop.price }));
    });

 

after fix:

 

    ui.IndexChange.on((index) => {
        mp.players.local.vehicleShop.model = data[Object.keys(data)[index + 1]].hash;
        mp.players.local.vehicleShop.price = data[Object.keys(data)[index + 1]].price;
    });
    ui.ItemSelect.on((item, index) => {
        mp.players.local.vehicleShop.model = data[Object.keys(data)[index + 1]].hash;
        mp.players.local.vehicleShop.price = data[Object.keys(data)[index + 1]].price;
        mp.events.callRemote("buyVehicleShop", carShopType, JSON.stringify({ "model": mp.players.local.vehicleShop.model, "price": mp.players.local.vehicleShop.price }));
    });

 

  • Like 1
deadyourlife

Posted

how can i activate the script. I have loaded packages to packeges but I always get an error in the console what I have to do. That is the error. Thanks for Help.

 

   "Carshop" loaded
Error: Error: Cannot find module 'config.json'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (C:\ragempserver\server-files\packages\Carshop\index.js:1:76)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)

  • Sad 1
FrozenStar22

Posted

i have no idea how to add this ingame, i did everything but its not ingame

bituu_

Posted

I can't see the blips and the markers

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
×
×
  • Create New...