Custom check for printers
First of all see this article that explains everything about adding/editing printers: https://www.gmodstore.com/help/addon/printers/configuration-21/topics/adding-editing-printers
Custom checks are added the same way you usually do it for entities in DarkRP. Use the following variables in the sh_printers.lua config file:
customCheck = function( ply )
return ply:GetUserGroup() == "donator"
end,
CustomCheckFailMsg = function( ply, tbl )
return "You need to be a donator to buy this entity!"
end,
Here is the platinum printer with this implemented:
CH_Printers.Printers[ "platinum" ] = {
PrintName = "Platinum Printer",
PrinterColor = Color( 217, 217, 217, 255 ),
PrinterLEDSkin = 12,
PrinterPrice = 5000,
PrinterMax = 2,
PrinterHealth = 150,
PrintMoneyInterval = 2,
PrintAmount = 16,
DefaultInkAmount = 225,
PrinterInkUsage = 2,
PrinterInkMax = 1000,
DefaultPaperAmount = 250,
PrinterPaperUsage = 2,
PrinterPaperMax = 1500,
AdjustTemperatureInterval = 16,
DefaultTemperature = 25,
MaxTemperature = 55,
DefaultFans = 0,
MaximumFans = 3,
DefaultStorage = 25000,
MaxStorage = 70000,
customCheck = function( ply )
return ply:GetUserGroup() == "donator"
end,
CustomCheckFailMsg = function( ply, tbl )
return "You need to be a donator to buy this entity!"
end,
}