Jump to content
Cease of Operations ×
GPM Site will go offline permanently on 30 November 2022 - New user registrations, support tickets disaabled. ×
MOD AUTHORS: As a reminder, we will not be keeping archival copies of your files. Please make sure you have appropriate backup copies.

Force Vehicle Extras in vehicles.json 1.0.0

   (0 reviews)

6 Screenshots

This plugin was EXTREMELY DIFFICULT to make, and I couldn't do it alone. A HUGE thanks for the assistance to @Grandpa Rexand @Natixco

 

My Discord: https://discord.gg/GmNua4ZY9K
Open Source: https://github.com/gggdunlix/FivePD-Set-Extras-in-Vehicles.json

HOW TO USE:

1. The DLL file must be put in your plugins folder

2. Your FivePD resource folder name must be exactly "fivepd" (without quotes)

3. Configure you vehicles.json

  • It should look something like this:
  • {
                "vehicle": "BCSO1",
                "name": "Charger (18)",
                "isAvailableForEveryone": false,
                "useRanks": false,
                "availableForDepartments": ["2"],
                "extras": [3, 5, 7, 8, 10]
            },

     

  • This makes it so the vehicle "bcso1" appears in duty menu with name "Charger (18)", isn't available for anyone, doesn't use ranks, is available for only department 2, and it uses extras 3, 5, 7, 8, and 10.
  •  
  • You also have the ability to set it as
  •  "extras": "all"

     

  • and
  •  "extras": "none"

     

  • to force all/no extras enabled.
    Make sure that there are no JSON errors. for example, I made sure there is a comma after 
    "availableForDepartments": ["2"],

     

 

Examples:

{
            "vehicle": "BCSO1",
            "name": "Charger (18)",
            "isAvailableForEveryone": false,
            "useRanks": false,
            "availableForDepartments": ["2"],
            "extras": [3, 5, 7, 8, 10]
        },

The BCSO1 has extras 3, 5, 7, 8, and 10 activated in **vehicles.json**. (These are lights, cameras, and roof items, etc) so they are activated by default in-game  when spawned with duty menu.

 

{
            "name": "Fire Truck",
            "vehicle": "firetruk",
            "isAvailableForEveryone": false,
            "useRanks": false,
            "availableForDepartments": ["6"],
            "extras": "none"
        },


The fire truck is set to have no extras, so the ram and it's other extras are default disabled when spawned with duty menu

 

{
            "name": "UM Cruiser",
            "vehicle": "police4",
            "isAvailableForEveryone": false,
            "useRanks": false,
            "availableForDepartments": ["2", "5", "4"],
            "extras": "all"
        },

The Unmarked Cruiser is set to have all extras enabled, so the Push bar and spotlights are enabled by default.

Edited by GGGDunlix
Add Discord & Source

A HUGE Thanks to @Grandpa Rexand @Natixco. They have helped me with several projects by this one was by far the most difficult.

Plugin code written by @Grandpa Rex, @Natixco, and @GGGDunlix.
Plugin idea given by @Grandpa Rex.

2018 Charger used in screenshots made by @PolarHusky99.

Instructions on how to use are in the regular desciption.
You can use this in your own server without crediting me, but you can't steal this file and upload it as your own.

You can use this in your own server without crediting me, but you can't steal this file and upload it as your own.

  • Like 1
  • Super Like 3
 Share


User Feedback

Recommended Comments



If something is wrong with the plugin or you would like me to add something, please feel free to PM, comment, or message me/my server on discord.

  • Like 1
  • Super Like 2
Link to comment
Share on other sites

Another great release, was fun tearing my hair out for the last 2 days 🤣

  • Super Like 2
Link to comment
Share on other sites

1 minute ago, Grandpa Rex said:

Another great release, was fun tearing my hair out for the last 2 days 🤣

haha same

  • Super Like 1
Link to comment
Share on other sites

20 minutes ago, Grandpa Rex said:

Another great release, was fun tearing my hair out for the last 2 days 🤣

 

18 minutes ago, GGGDunlix said:

haha same

It was worth it, you guys made an another amazing plugin! :snailparty:

  • Super Like 1
Link to comment
Share on other sites

2 minutes ago, Alex W. said:

 

It was worth it, you guys made an another amazing plugin! :snailparty:

Thanks for the support!🥳

  • Super Like 1
Link to comment
Share on other sites

Great idea. Will work well in combination with your license plate plugin. I had missed this post when I had commented over there. The only other thing that could be a negative for this is that while it is great for having car extras be uniform for all players who drive that vehicle, it doesn't work as well if different players want different lighting setups for the same vehicle. That is fine though as long as this doesn't do a constant override of the extras and is only applied when spawning a car via the Duty Menu. (I think that's how you set this up, I haven't done proper testing of your plugin) If players want to make further changes to their Extras after what is already set via your plugin's config, they can use something like vMenu for that. But this is perfect for departments who have a policy to which Extras are allowed.

  • Like 1
Link to comment
Share on other sites

50 minutes ago, Peelster1 said:

Great idea. Will work well in combination with your license plate plugin. I had missed this post when I had commented over there. The only other thing that could be a negative for this is that while it is great for having car extras be uniform for all players who drive that vehicle, it doesn't work as well if different players want different lighting setups for the same vehicle. That is fine though as long as this doesn't do a constant override of the extras and is only applied when spawning a car via the Duty Menu. (I think that's how you set this up, I haven't done proper testing of your plugin) If players want to make further changes to their Extras after what is already set via your plugin's config, they can use something like vMenu for that. But this is perfect for departments who have a policy to which Extras are allowed.

You are exactly correct, this only applies extras to vehicles spawned with duty menu.  You can use vMenu to change settings and add it as a saved vehicle if you would like.

  • Like 1
Link to comment
Share on other sites

13 minutes ago, phase gaming said:

Does this work for lspdfr?

 

No, this is only for FivePD

Link to comment
Share on other sites

this isnt working for me.  its in my plugins folder and the lines have been added to the vehicle file.  vehicles.json has been checked with a json linter and is good to go.  any advice?

Link to comment
Share on other sites

On 6/19/2022 at 9:34 PM, vladimirXXputin said:

this isnt working for me.  its in my plugins folder and the lines have been added to the vehicle file.  vehicles.json has been checked with a json linter and is good to go.  any advice?

Any console errors after trying to spawn a vehicle with configured extras?

Link to comment
Share on other sites

On 8/31/2022 at 9:24 AM, ParadiseNetwork said:

It wont work for me you got any ideas how to fix?

Did you put it in the plugins folder? Did you restart Fivepd and check that the vehicles.json is formatted correctly? Are there any errors in the F8 console?

Link to comment
Share on other sites

1. are the DLL files (for both plugins, the Livery one and the Extras one) in the FivePD Plugins folder?
2. After installing, did you restart your server?
3. Send your vehicles.json
4. Press F8 after spawning a car in-game. send a screenshot of what's there.

  • Like 1
Link to comment
Share on other sites

4 minutes ago, GGGDunlix said:

1. are the DLL files (for both plugins, the Livery one and the Extras one) in the FivePD Plugins folder?
2. After installing, did you restart your server?
3. Send your vehicles.json
4. Press F8 after spawning a car in-game. send a screenshot of what's there.

{
	"police": [
		{
			"name": "Police",
			"vehicle": "police",
			"isAvailableForEveryone": true
		},
		{
			"name": "Police 2",
			"vehicle": "police2",
			"isAvailableForEveryone": false,
		},
		{
            "vehicle": "spaudi",
            "name": "SE Audi RS6 ",
            "isAvailableForEveryone": true,
        },
		{
            "vehicle": "rmodaudirs7",
            "name": "Audi RS7",
            "isAvailableForEveryone": true,
        },
		{
            "vehicle": "22g63",
            "name": "Unmarked G63",
            "isAvailableForEveryone": true,
        },
	    {
            "vehicle": "745le",
            "name": "Unmarked BMW 745",
            "isAvailableForEveryone": true,
        },
		{
            "vehicle": "pdbmw",
            "name": "BMW M5",
			"extras": [1, 2, 3, 4, 5, 6, 7, 8, 9],
            "isAvailableForEveryone": true,
        },
		{
            "vehicle": "18legchargrb",
            "name": "Dodge Charger ",
            "isAvailableForEveryone": true,
        },
		{
            "vehicle": "21dura",
            "name": "LSPD Durango",
            "isAvailableForEveryone": true,
        },
		{
            "vehicle": "poldemonrb",
            "name": "LSPD Dodge Demon",
            "isAvailableForEveryone": true,
        },
		{
            "vehicle": "unmdur",
            "name": "[ELS]Unmarked Dodge SRT",
            "isAvailableForEveryone": true,
        },
		{
            "vehicle": "camaroRB",
            "name": "Camaro",
            "isAvailableForEveryone": true,
        },

		{
			"name": "Police 3",
			"vehicle": "police3",
			"isAvailableForEveryone": false,
		},
		{
			"name": "Police 4",
			"vehicle": "police4",
			"isAvailableForEveryone": false,
		},
		{
			"name": "sheriff2",
			"vehicle": "sheriff2",
			"isAvailableForEveryone": true
		}
	],
	"ambulance": ["ambulance"],
	"airAmbulance": ["polmav"],
	"firedept": ["firetruk"],
	"coroner": ["speedo", "utillitruck3"],
	"towtruck": ["flatbed"],
	"mechanic": ["utillitruck3"],
	"prisontransport": ["police"],
	"animalControl": ["bison"],
	"taxi": ["taxi"]
}

image.thumb.png.0e59cbb3a61397edbf825f25a4fbd4a7.png
First Time i see this error
Livery is not Installed atm.

Link to comment
Share on other sites

1 minute ago, ParadiseNetwork said:
{
	"police": [
		{
			"name": "Police",
			"vehicle": "police",
			"isAvailableForEveryone": true
		},
		{
			"name": "Police 2",
			"vehicle": "police2",
			"isAvailableForEveryone": false,
		},
		{
            "vehicle": "spaudi",
            "name": "SE Audi RS6 ",
            "isAvailableForEveryone": true,
        },
		{
            "vehicle": "rmodaudirs7",
            "name": "Audi RS7",
            "isAvailableForEveryone": true,
        },
		{
            "vehicle": "22g63",
            "name": "Unmarked G63",
            "isAvailableForEveryone": true,
        },
	    {
            "vehicle": "745le",
            "name": "Unmarked BMW 745",
            "isAvailableForEveryone": true,
        },
		{
            "vehicle": "pdbmw",
            "name": "BMW M5",
			"extras": [1, 2, 3, 4, 5, 6, 7, 8, 9],
            "isAvailableForEveryone": true,
        },
		{
            "vehicle": "18legchargrb",
            "name": "Dodge Charger ",
            "isAvailableForEveryone": true,
        },
		{
            "vehicle": "21dura",
            "name": "LSPD Durango",
            "isAvailableForEveryone": true,
        },
		{
            "vehicle": "poldemonrb",
            "name": "LSPD Dodge Demon",
            "isAvailableForEveryone": true,
        },
		{
            "vehicle": "unmdur",
            "name": "[ELS]Unmarked Dodge SRT",
            "isAvailableForEveryone": true,
        },
		{
            "vehicle": "camaroRB",
            "name": "Camaro",
            "isAvailableForEveryone": true,
        },

		{
			"name": "Police 3",
			"vehicle": "police3",
			"isAvailableForEveryone": false,
		},
		{
			"name": "Police 4",
			"vehicle": "police4",
			"isAvailableForEveryone": false,
		},
		{
			"name": "sheriff2",
			"vehicle": "sheriff2",
			"isAvailableForEveryone": true
		}
	],
	"ambulance": ["ambulance"],
	"airAmbulance": ["polmav"],
	"firedept": ["firetruk"],
	"coroner": ["speedo", "utillitruck3"],
	"towtruck": ["flatbed"],
	"mechanic": ["utillitruck3"],
	"prisontransport": ["police"],
	"animalControl": ["bison"],
	"taxi": ["taxi"]
}

image.thumb.png.0e59cbb3a61397edbf825f25a4fbd4a7.png
First Time i see this error
Livery is not Installed atm.

You're vehicles.json is formatted WAY incorrectly.
Give me a moment to fix this

  • Like 1
Link to comment
Share on other sites

1 minute ago, GGGDunlix said:

You're vehicles.json is formatted WAY incorrectly.
Give me a moment to fix this

Rhx for helping me sooo much 😍

Link to comment
Share on other sites

On the last line in any JSON Array, there cannot be a comma:

{
			"vehicle": "pdbmw",
			"name": "BMW M5",
			"extras": [1, 2, 3, 4, 5, 6, 7, 8, 9],
			"isAvailableForEveryone": true
}


I got rid of the comma after "true" for example. do that with the rest of the vehicles on the last line of each config

Link to comment
Share on other sites

1 minute ago, GGGDunlix said:

Then send your config again

{
	"police": [
		{
			"name": "Police",
			"vehicle": "police",
			"isAvailableForEveryone": true
		},
		{
			"name": "Police 2",
			"vehicle": "police2",
			"isAvailableForEveryone": false
		},
		{
            "vehicle": "spaudi",
            "name": "SE Audi RS6 ",
            "isAvailableForEveryone": true
        },
		{
            "vehicle": "rmodaudirs7",
            "name": "Audi RS7",
            "isAvailableForEveryone": true
        },
		{
            "vehicle": "22g63",
            "name": "Unmarked G63",
            "isAvailableForEveryone": true
        },
	    {
            "vehicle": "745le",
            "name": "Unmarked BMW 745",
            "isAvailableForEveryone": true
        },
		{
            "vehicle": "pdbmw",
            "name": "BMW M5",
			"extras": [1, 2, 3, 4, 5, 6, 7, 8, 9],
            "isAvailableForEveryone": true
        },
		{
            "vehicle": "18legchargrb",
            "name": "Dodge Charger ",
            "isAvailableForEveryone": true
        },
		{
            "vehicle": "21dura",
            "name": "LSPD Durango",
            "isAvailableForEveryone": true
        },
		{
            "vehicle": "poldemonrb",
            "name": "LSPD Dodge Demon",
            "isAvailableForEveryone": true
        },
		{
            "vehicle": "unmdur",
            "name": "[ELS]Unmarked Dodge SRT",
            "isAvailableForEveryone": true
        },
		{
            "vehicle": "camaroRB",
            "name": "Camaro",
            "isAvailableForEveryone": true
        },

		{
			"name": "Police 3",
			"vehicle": "police3",
			"isAvailableForEveryone": false
		},
		{
			"name": "Police 4",
			"vehicle": "police4",
			"isAvailableForEveryone": false
		},
		{
			"name": "sheriff2",
			"vehicle": "sheriff2",
			"isAvailableForEveryone": true
		}
	],
	"ambulance": ["ambulance"],
	"airAmbulance": ["polmav"],
	"firedept": ["firetruk"],
	"coroner": ["speedo", "utillitruck3"],
	"towtruck": ["flatbed"],
	"mechanic": ["utillitruck3"],
	"prisontransport": ["police"],
	"animalControl": ["bison"],
	"taxi": ["taxi"]
}

 

Link to comment
Share on other sites

1 minute ago, ParadiseNetwork said:
{
	"police": [
		{
			"name": "Police",
			"vehicle": "police",
			"isAvailableForEveryone": true
		},
		{
			"name": "Police 2",
			"vehicle": "police2",
			"isAvailableForEveryone": false
		},
		{
            "vehicle": "spaudi",
            "name": "SE Audi RS6 ",
            "isAvailableForEveryone": true
        },
		{
            "vehicle": "rmodaudirs7",
            "name": "Audi RS7",
            "isAvailableForEveryone": true
        },
		{
            "vehicle": "22g63",
            "name": "Unmarked G63",
            "isAvailableForEveryone": true
        },
	    {
            "vehicle": "745le",
            "name": "Unmarked BMW 745",
            "isAvailableForEveryone": true
        },
		{
            "vehicle": "pdbmw",
            "name": "BMW M5",
			"extras": [1, 2, 3, 4, 5, 6, 7, 8, 9],
            "isAvailableForEveryone": true
        },
		{
            "vehicle": "18legchargrb",
            "name": "Dodge Charger ",
            "isAvailableForEveryone": true
        },
		{
            "vehicle": "21dura",
            "name": "LSPD Durango",
            "isAvailableForEveryone": true
        },
		{
            "vehicle": "poldemonrb",
            "name": "LSPD Dodge Demon",
            "isAvailableForEveryone": true
        },
		{
            "vehicle": "unmdur",
            "name": "[ELS]Unmarked Dodge SRT",
            "isAvailableForEveryone": true
        },
		{
            "vehicle": "camaroRB",
            "name": "Camaro",
            "isAvailableForEveryone": true
        },

		{
			"name": "Police 3",
			"vehicle": "police3",
			"isAvailableForEveryone": false
		},
		{
			"name": "Police 4",
			"vehicle": "police4",
			"isAvailableForEveryone": false
		},
		{
			"name": "sheriff2",
			"vehicle": "sheriff2",
			"isAvailableForEveryone": true
		}
	],
	"ambulance": ["ambulance"],
	"airAmbulance": ["polmav"],
	"firedept": ["firetruk"],
	"coroner": ["speedo", "utillitruck3"],
	"towtruck": ["flatbed"],
	"mechanic": ["utillitruck3"],
	"prisontransport": ["police"],
	"animalControl": ["bison"],
	"taxi": ["taxi"]
}

 


OK, it says this is valid:
 

{
	"police": [{
			"name": "Police",
			"vehicle": "police",
			"isAvailableForEveryone": true
		},
		{
			"name": "Police 2",
			"vehicle": "police2",
			"isAvailableForEveryone": false
		},
		{
			"vehicle": "spaudi",
			"name": "SE Audi RS6 ",
			"isAvailableForEveryone": true
		},
		{
			"vehicle": "rmodaudirs7",
			"name": "Audi RS7",
			"isAvailableForEveryone": true
		},
		{
			"vehicle": "22g63",
			"name": "Unmarked G63",
			"isAvailableForEveryone": true
		},
		{
			"vehicle": "745le",
			"name": "Unmarked BMW 745",
			"isAvailableForEveryone": true
		},
		{
			"vehicle": "pdbmw",
			"name": "BMW M5",
			"extras": [1, 2, 3, 4, 5, 6, 7, 8, 9],
			"isAvailableForEveryone": true
		},
		{
			"vehicle": "18legchargrb",
			"name": "Dodge Charger ",
			"isAvailableForEveryone": true
		},
		{
			"vehicle": "21dura",
			"name": "LSPD Durango",
			"isAvailableForEveryone": true
		},
		{
			"vehicle": "poldemonrb",
			"name": "LSPD Dodge Demon",
			"isAvailableForEveryone": true
		},
		{
			"vehicle": "unmdur",
			"name": "[ELS]Unmarked Dodge SRT",
			"isAvailableForEveryone": true
		},
		{
			"vehicle": "camaroRB",
			"name": "Camaro",
			"isAvailableForEveryone": true
		},

		{
			"name": "Police 3",
			"vehicle": "police3",
			"isAvailableForEveryone": false
		},
		{
			"name": "Police 4",
			"vehicle": "police4",
			"isAvailableForEveryone": false
		},
		{
			"name": "sheriff2",
			"vehicle": "sheriff2",
			"isAvailableForEveryone": true
		}
	],
	"ambulance": ["ambulance"],
	"airAmbulance": ["polmav"],
	"firedept": ["firetruk"],
	"coroner": ["speedo", "utillitruck3"],
	"towtruck": ["flatbed"],
	"mechanic": ["utillitruck3"],
	"prisontransport": ["police"],
	"animalControl": ["bison"],
	"taxi": ["taxi"]
}

Try this, restart FivePD, and check console for errors.

Link to comment
Share on other sites

2 minutes ago, GGGDunlix said:


OK, it says this is valid:
 

{
	"police": [{
			"name": "Police",
			"vehicle": "police",
			"isAvailableForEveryone": true
		},
		{
			"name": "Police 2",
			"vehicle": "police2",
			"isAvailableForEveryone": false
		},
		{
			"vehicle": "spaudi",
			"name": "SE Audi RS6 ",
			"isAvailableForEveryone": true
		},
		{
			"vehicle": "rmodaudirs7",
			"name": "Audi RS7",
			"isAvailableForEveryone": true
		},
		{
			"vehicle": "22g63",
			"name": "Unmarked G63",
			"isAvailableForEveryone": true
		},
		{
			"vehicle": "745le",
			"name": "Unmarked BMW 745",
			"isAvailableForEveryone": true
		},
		{
			"vehicle": "pdbmw",
			"name": "BMW M5",
			"extras": [1, 2, 3, 4, 5, 6, 7, 8, 9],
			"isAvailableForEveryone": true
		},
		{
			"vehicle": "18legchargrb",
			"name": "Dodge Charger ",
			"isAvailableForEveryone": true
		},
		{
			"vehicle": "21dura",
			"name": "LSPD Durango",
			"isAvailableForEveryone": true
		},
		{
			"vehicle": "poldemonrb",
			"name": "LSPD Dodge Demon",
			"isAvailableForEveryone": true
		},
		{
			"vehicle": "unmdur",
			"name": "[ELS]Unmarked Dodge SRT",
			"isAvailableForEveryone": true
		},
		{
			"vehicle": "camaroRB",
			"name": "Camaro",
			"isAvailableForEveryone": true
		},

		{
			"name": "Police 3",
			"vehicle": "police3",
			"isAvailableForEveryone": false
		},
		{
			"name": "Police 4",
			"vehicle": "police4",
			"isAvailableForEveryone": false
		},
		{
			"name": "sheriff2",
			"vehicle": "sheriff2",
			"isAvailableForEveryone": true
		}
	],
	"ambulance": ["ambulance"],
	"airAmbulance": ["polmav"],
	"firedept": ["firetruk"],
	"coroner": ["speedo", "utillitruck3"],
	"towtruck": ["flatbed"],
	"mechanic": ["utillitruck3"],
	"prisontransport": ["police"],
	"animalControl": ["bison"],
	"taxi": ["taxi"]
}

Try this, restart FivePD, and check console for errors.

Same error 😞

Link to comment
Share on other sites


Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

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

Important Information

Thanks for visiting GPM. As a user of the GTAPoliceMods platform, we ask that you review the Terms of Use, Privacy Policy, and Guidelines. These principles allow us to continue fostering a great community. We have placed cookies on your device to help improve your experience. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.