Making Vehicles VIP only Darkrp

Hey I was wondering how I would make it so a vehicle can only be purchased by someone who has the group “VIP”. I am using ULX and here is the Vehicle Code.


AddCustomVehicle("blue_x111", "models/futurecar1.mdl", 7000)

Thanks

if ply:IsUserGroup(“vip”) then
AddCustomVehicle)(“blue_x111”, “models/futurecar1.mdl”, 7000)
end

You sir, You sir are very incredibly stupid.


(User was banned for this post ("Flaming" - Craptasket))

this is for donators and (super)admins
if you only want donator remove the: or ply: 's

[lua] AddCustomVehicle(“blue_x111”, “models/futurecar1.mdl”, 7000, customCheck = function(ply)
return ply:IsUserGroup(“donator”) or ply:IsUserGroup(“admin”) or ply:IsUserGroup(“superadmin”)
end[/lua]

CustomCheck is for the new syntax.

that works for me, shut up mah boy

I do this


AddCustomVehicle("blue_x111", "models/futurecar1.mdl", 7000, customCheck = function(ply)
return ply:IsUserGroup("donator") or ply:IsUserGroup("admin") or ply:IsUserGroup("superadmin")
end

But then I get this error.


[ERROR] gamemodes/darkrp/gamemode/addentities.lua:610: ')' expected near '='
  1. unknown - gamemodes/darkrp//gamemode/addentities.lua:0

Can’t seem to get it to work.


AddCustomVehicle("blue_x111", "models/futurecar1.mdl", 7000, customCheck = function(ply)
return ply:IsUserGroup("donator") or ply:IsUserGroup("admin") or ply:IsUserGroup("superadmin")
end)

might work but I think the whole syntax is wrong but you were missing a )… just like the error says

Ye I also tried that but still says that I need a ) near =

Because you can’t do that way.

Function from DarkRP file MakeThings.lua (unedited)

[lua]
function AddCustomVehicle(Name_of_vehicle, model, price, Jobs_that_can_buy_it)
– the rest of the function
[/lua]
You can’t make customCheck with vehicles.

darkrp has a wiki full of anything that you would like to know http://wiki.darkrp.com/index.php/Main_Page

It can’t really help him since there is no way in addentities.lua to make the check.