dobrograd-13-06-2022/garrysmod/addons/feature-jobs/lua/dbg-jobs/sh_hooks.lua
Jonny_Bro (Nikita) e4d5311906 first commit
2023-11-16 15:01:19 +05:00

21 lines
763 B
Lua
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

hook.Add('car-dealer.populateTags', 'dbg-jobs.trucks', function(id, data, tags)
if list.Get('simfphys_vehicles')[data.simfphysID].Members.CanAttachPackages then
tags[#tags + 1] = carDealer.tags.truck
end
end)
local cookForbidden = octolib.array.toKeys({ 'Доставка еды' })
hook.Add('dbg-jobs.canTake', 'dbg-jobs.restrict', function(ply, publishData)
if ply:IsGhost() then
return false, 'Мертвые не могут этого делать'
end
if ply:GetNetVar('dbg-police.job', '') ~= '' then
return false, 'Полицейские не могут принимать заказы'
end
if ply:isCook() and cookForbidden[publishData.name] then
return false, 'Повар готовит еду, а не доставляет'
end
end)