Donator Entities

From Official DarkRP Wiki
Jump to: navigation, search


This page is available in the following languages:
Данная версия страницы доступна на следующих языках:
Jarvis-flag 8010.png English | Russia-flag.png Русский | France-flag.png Français

Introduction

Making shipments or other entities Donator only. Instead of donator you can also make it VIP only or have other constraints.

Details

The customCheck field can hold a custom function that defines whether a player can buy it or not.

The setup is the same as the donator job thing. Here are a few examples:

DescriptionMake the Money printer Donator only.
Used onNewerShared.png
Code
DarkRP.createEntity("Money printer", {
	ent = "money_printer",
	model = "models/props_c17/consolebox01a.mdl",
	price = 1000,
	max = 2,
	cmd = "buymoneyprinter",
	customCheck = function(ply) return ply:IsUserGroup("Donator") end
})
OutputThe Money printer is only available to the "Donator" group.


DescriptionMake the AK47 shipment Donator only.
Used onNewerShared.png
Code
DarkRP.createShipment("AK47", {
	model = "models/weapons/w_rif_ak47.mdl",
	entity = "weapon_ak472",
	price = 2450,
	amount = 10,
	separate = false,
	pricesep = nil,
	noship = false,
	allowed = {TEAM_GUN},
	customCheck = function(ply) return ply:IsUserGroup("Donator") end
})
OutputThe AK47 shipment is only available to the "Donator" group.