Synchronous server-side decision functions located in custom/server/validate.lua. Return true to allow the action on the server or false to reject it.
Validates before awarding money and removing drugs during NPC drug sales.
CanSellNPCServer = function(source, zoneData, item, amount, price, currency)
return true
end| Parameter | Type | Description |
|---|---|---|
source |
number | Player server ID |
zoneData |
table | Zone configuration table or default setting |
item |
string | Item name being sold |
amount |
number | Quantity being sold |
price |
number | Total price expected |
currency |
string | Currency type (cash, black_money, etc.) |
boolean - true to approve transaction, false to reject.Validates when a player sells items to a dealer shop.
CanSellDealerServer = function(source, shopData, item, amount, price, currency)
return true
end| Parameter | Type | Description |
|---|---|---|
source |
number | Player server ID |
shopData |
table | Dealer configuration table |
item |
string | Item name being sold |
amount |
number | Quantity being sold |
price |
number | Total price expected |
currency |
string | Currency type |
boolean - true to approve sale, false to reject.Validates when a player purchases items from a dealer shop.
CanBuyDealerServer = function(source, shopData, item, amount, price, currency)
return true
end| Parameter | Type | Description |
|---|---|---|
source |
number | Player server ID |
shopData |
table | Dealer configuration table |
item |
string | Item name being purchased |
amount |
number | Quantity being purchased |
price |
number | Total price required |
currency |
string | Currency type |
boolean - true to approve purchase, false to reject.Validates when a player deposits drugs into a corner boy.
CanStockCornerboyServer = function(source, cornerboyData, item, amount)
return true
end| Parameter | Type | Description |
|---|---|---|
source |
number | Player server ID |
cornerboyData |
table | Corner boy configuration table |
item |
string | Item name being stocked |
amount |
number | Quantity being stocked |
boolean - true to approve deposit, false to reject.Validates when a player requests to start harvesting a plant in a drug field.
CanHarvestFieldServer = function(source, fieldData, plantId)
return true
end| Parameter | Type | Description |
|---|---|---|
source |
number | Player server ID |
fieldData |
table | Field configuration table |
plantId |
number | Plant index in field |
boolean - true to approve harvesting, false to reject.Validates when a player claims an item from a collection zone.
CanCollectServer = function(source, collectData)
return true
end| Parameter | Type | Description |
|---|---|---|
source |
number | Player server ID |
collectData |
table | Collection zone configuration table |
boolean - true to approve collection, false to reject.Validates when a player processes materials in a laboratory zone.
CanProcessServer = function(source, processData)
return true
end| Parameter | Type | Description |
|---|---|---|
source |
number | Player server ID |
processData |
table | Process zone configuration table |
boolean - true to approve processing, false to reject.Validates when a player finishes handcrafting an item.
CanHandcraftServer = function(source, craftData)
return true
end| Parameter | Type | Description |
|---|---|---|
source |
number | Player server ID |
craftData |
table | Handcraft recipe table |
boolean - true to approve crafting, false to reject.Validates before a drug is consumed and its effects are applied on the server.
CanUseDrugServer = function(source, item, drugData)
return true
end| Parameter | Type | Description |
|---|---|---|
source |
number | Player server ID |
item |
string | Drug item name being consumed |
drugData |
table | Drug configuration and effects table |
boolean - true to approve drug consumption, false to reject.