How to add customchecks (VIP, Admin only vehicles) ?
If you want to restrict your vehicle to a condition, add a customchecks in your configuration file :
advanced-car-dealer\lua\advancedcardealer\sh_config.lua
Here is an example of customcheck you can add for VIPs :
AdvCarDealer.CustomChecks = {
[ "VIP only" ] = {
func = function( ply ) return ply:GetUserGroup() == "VIP" end,
messageCatalog = "This vehicle is limited to VIP users.",
onlyOnceBuying = false, -- if the check has to be done only once buying, or also when the player try to take it from the garage.
}
}
Here is an example if you want to add more than one customcheck :
AdvCarDealer.CustomChecks = {
[ "VIP only" ] = {
func = function( ply ) return ply:GetUserGroup() == "VIP" end,
messageCatalog = "This vehicle is limited to VIP users.",
onlyOnceBuying = false, -- if the check has to be done only once buying, or also when the player try to take it from the garage.
},
[ "Police only" ] = {
func = function( ply ) return ply:isCP() end,
messageCatalog = "This vehicle is limited to police.",
onlyOnceBuying = false,
},
[ "Team name only" ] = {
func = function( ply ) return team.GetName( ply:Team() ) == "Team Name" end,
messageCatalog = "This vehicle is limited to Team name.",
onlyOnceBuying = false,
}
}
Once it's done, you can edit your cars in-game to select the customcheck you want.