Welcome to Сообщество игровых серверов NETZONA.ORG

Присоединяйтесь к нам сейчас, чтобы получить доступ ко всем нашим функциям. Зарегистрировавшись и войдя в систему, вы сможете создавать темы, публиковать ответы в существующих темах, давать репутацию другим участникам, получать собственный личный мессенджер и многое другое. Это также быстро и совершенно бесплатно, так чего же вы ждете?
  • Приветствуем на сайте, Гость! Обязательно ознакомьтесь с условиями и правилами Публичной оферты Проекта NetZONA.org: https://netzona.org/help/public-offer/

  • Приветствуем на сайте, Гость! Обязательно ознакомьтесь с условиями и правилами использования Ваших файлов cookie на Проекте NetZONA.org: https://netzona.org/help/cookies/

  • Приветствуем на сайте, Гость! Обязательно ознакомьтесь с Политикой конфиденциальности Проекта NetZONA.org: https://netzona.org/pages/privacy-policy/

  • Ответы на основные вопросы: https://netzona.org/threads/populjarnye-voprosy-i-otvety-na-nix.6122/

  • Приветствуем на сайте, Гость! Приобрести (купить) Информационную услугу (в том числе группу "Проверенный") на Проекте NetZONA.org: https://netzona.org/account/upgrades

Проблема Нужен скупщик item'ов в DarkRP

My Marlboro

Пользователь
Регистрация
3 Апр 2017
Сообщения
11
Реакции
0
Баллы
13
Возраст
25
Пол
Нужен новый скупщик или решение проблем со старым.
По первому:Скупщик должен просто брать предметы и отдавать.
А по второму(починке):Скупщик должен только изымать предметы за деньги, но тот вместо этого их продает.

[HIDE]
NpcDrugAllowedTeam = {}
local function AddInTableDrugs(team)
if team != nil then
NpcDrugAllowedTeam[team] = false
end
end

CDrugs = {}
-------------------- CONFIG ZONE ---------------------------------------
timer.Simple(2,function()
AddInTableDrugs(TEAM_CITIZEN) -- here we add teams, who can talk with our dug NPC
end)
CDrugs.Items = {}

-- here we adding items, what our npc can sell
CDrugs.Items[1] = {["price"] = 1,["name"] = "text",["mdl"] = "models/error.mdl",["class"] = "ent"}

----------------------------------------------------- ------------------------
/*
---------------------------------------------------------------------------------
CDrugs.Items[47] = {["price"] = 0,["name"] = "",["mdl"] = "",["class"] = ""}
CDrugs.Items[48] = {["price"] = 0,["name"] = "",["mdl"] = "",["class"] = ""}
CDrugs.Items[49] = {["price"] = 0,["name"] = "",["mdl"] = "",["class"] = ""}
CDrugs.Items[50] = {["price"] = 0,["name"] = "",["mdl"] = "",["class"] = ""}
CDrugs.Items[51] = {["price"] = 0,["name"] = "",["mdl"] = "",["class"] = ""}
CDrugs.Items[52] = {["price"] = 0,["name"] = "",["mdl"] = "",["class"] = ""}
CDrugs.Items[53] = {["price"] = 0,["name"] = "",["mdl"] = "",["class"] = ""}
CDrugs.Items[54] = {["price"] = 0,["name"] = "",["mdl"] = "",["class"] = ""}
CDrugs.Items[55] = {["price"] = 0,["name"] = "",["mdl"] = "",["class"] = ""}
CDrugs.Items[56] = {["price"] = 0,["name"] = "",["mdl"] = "",["class"] = ""}
CDrugs.Items[57] = {["price"] = 0,["name"] = "",["mdl"] = "",["class"] = ""}
CDrugs.Items[58] = {["price"] = 0,["name"] = "",["mdl"] = "",["class"] = ""}
CDrugs.Items[59] = {["price"] = 0,["name"] = "",["mdl"] = "",["class"] = ""}
CDrugs.Items[60] = {["price"] = 0,["name"] = "",["mdl"] = "",["class"] = ""}
CDrugs.Items[61] = {["price"] = 0,["name"] = "",["mdl"] = "",["class"] = ""}
CDrugs.Items[62] = {["price"] = 0,["name"] = "",["mdl"] = "",["class"] = ""}
CDrugs.Items[63] = {["price"] = 0,["name"] = "",["mdl"] = "",["class"] = ""}
CDrugs.Items[64] = {["price"] = 0,["name"] = "",["mdl"] = "",["class"] = ""}
CDrugs.Items[65] = {["price"] = 0,["name"] = "",["mdl"] = "",["class"] = ""}
CDrugs.Items[66] = {["price"] = 0,["name"] = "",["mdl"] = "",["class"] = ""}
CDrugs.Items[67] = {["price"] = 0,["name"] = "",["mdl"] = "",["class"] = ""}
CDrugs.Items[68] = {["price"] = 0,["name"] = "",["mdl"] = "",["class"] = ""}
CDrugs.Items[69] = {["price"] = 0,["name"] = "",["mdl"] = "",["class"] = ""}
CDrugs.Items[70] = {["price"] = 0,["name"] = "",["mdl"] = "",["class"] = ""}
CDrugs.Items[71] = {["price"] = 0,["name"] = "",["mdl"] = "",["class"] = ""}
CDrugs.Items[72] = {["price"] = 0,["name"] = "",["mdl"] = "",["class"] = ""}
CDrugs.Items[73] = {["price"] = 0,["name"] = "",["mdl"] = "",["class"] = ""}
CDrugs.Items[74] = {["price"] = 0,["name"] = "",["mdl"] = "",["class"] = ""}
CDrugs.Items[75] = {["price"] = 0,["name"] = "",["mdl"] = "",["class"] = ""}
CDrugs.Items[76] = {["price"] = 0,["name"] = "",["mdl"] = "",["class"] = ""}
CDrugs.Items[77] = {["price"] = 0,["name"] = "",["mdl"] = "",["class"] = ""}
CDrugs.Items[78] = {["price"] = 0,["name"] = "",["mdl"] = "",["class"] = ""}
CDrugs.Items[79] = {["price"] = 0,["name"] = "",["mdl"] = "",["class"] = ""}
CDrugs.Items[80] = {["price"] = 0,["name"] = "",["mdl"] = "",["class"] = ""}
---------------------------------------------------------------------------------
*/
/*
---------------------------------------------------------------------------------
Variables
---------------------------------------------------------------------------------
*/
CDrugs.SellWeedToNPCprice = 1000 -- price, what NPC give you for weeds
CDrugs.CountOfBongCanBeUsed = 100000 -- the number of times you can smoke
CDrugs.GrowingSpeed = 5 -- growing every N sec
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
if CLIENT then
/*
---------------------------------------------------------------------------------
Variables
---------------------------------------------------------------------------------
*/
LocalPlayer().HaveDrugs = true
local TGKlevel = 0
local DrawDrugMotion = false
local SharpenShit = 0
local SharpenShitUp = true
CDrugs.Time = 15 -- every N sec we will be a little better (15 minimum)
-- add here funny skins
CDrugs.Skins = {}
-- download bunny skin too or replace it on another funny skin
CDrugs.Skins[1] = "models/stalkertnb/bloodsucker2.mdl" -- funny skins from here http://steamcommunity.com/sharedfiles/filedetails/?id=395510347&searchtext=five
CDrugs.Skins[2] = "models/stalkertnb/baldry_priest.mdl" -- funny skins from here http://steamcommunity.com/sharedfiles/filedetails/?id=395510347&searchtext=five
CDrugs.Skins[3] = "models/stalkertnb/rad_monoboss.mdl" -- funny skins from here http://steamcommunity.com/sharedfiles/filedetails/?id=395510347&searchtext=five
CDrugs.Skins[4] = "models/stalkertnb/burer1.mdl" -- funny skins from here http://steamcommunity.com/sharedfiles/filedetails/?id=395510347&searchtext=five
CDrugs.Skins[5] = "models/stalkertnb/bandit0.mdl" -- funny skins from here http://steamcommunity.com/sharedfiles/filedetails/?id=395510347&searchtext=five
CDrugs.Skins[6] = "models/stalkertnb/exo_muffin.mdl" -- funny skins from here http://steamcommunity.com/sharedfiles/filedetails/?id=395510347&searchtext=five
CDrugs.Skins[7] = "models/stalkertnb/exo_thrasos.mdl"
CDrugs.Skins[8] = "models/stalkertnb/exo_zaku.mdl"
--CDrugs.Skins[2] = "models/player/alyx.mdl"
--CDrugs.Skins[3] = "models/player/barney.mdl"
-- add here funny pharases
CDrugs.Phrases = {}
CDrugs.Phrases[1] = "В рот ебал долг"
CDrugs.Phrases[2] = "ОТЖИТИЕ НАхУй!!!!"
CDrugs.Phrases[3] = "Свобода!!!!"
CDrugs.Phrases[4] = "Кто если не я?!"
CDrugs.Phrases[5] = "Держите меня семеро!"
CDrugs.Phrases[6] = "*Харкунл на пол*"
CDrugs.Phrases[6] = "*кхе-кхе*"
----------------------- END CONFIG ZONE -----------------------------------
----------------------- END CONFIG ZONE -----------------------------------
----------------------- END CONFIG ZONE -----------------------------------
/*
---------------------------------------------------------------------------------
FunnySkins
---------------------------------------------------------------------------------
*/
local function FunnySkins()
for i,ply in pairs(player.GetAll()) do
if math.random(1,3) == 2 && ply.drugModel == nil then
ply.oldModel = ply:GetModel()
ply.drugModel = table.Random(CDrugs.Skins)
ply:SetModel(ply.drugModel)
end
end
end
local function DissableSkins()
for i,ply in pairs(player.GetAll()) do
if ply.drugModel != nil then
if string.lower(ply:GetModel()) == string.lower(ply.drugModel) then
ply:SetModel(ply.oldModel)
end
ply.drugModel = nil
end
end
end

/*
---------------------------------------------------------------------------------
Bone Drugs
---------------------------------------------------------------------------------
*/
local MaxRange = 1500 -- maximum distance from You to target
local function CanSee( ply, pos )
if ply:GetShootPos():Distance(pos) > MaxRange then return false end
local trdata = {}
trdata.start = ply:GetShootPos()
trdata.endpos = pos
trdata.mask = CONTENTS_SOLID
trdata.filter = ply
local res = util.TraceLine(trdata)
if res.Hit then return false end
return true
end

local function JBone(ply,bone,vec,pos)
if not IsValid(ply) then return end
local boneid = ply:LookupBone(bone)
if boneid == nil then return end
ply:ManipulateBoneScale(boneid, vec)
ply:ManipulateBonePosition(boneid,pos)
-- ply:SetupBones()
end
local function JboneGo(ply)
JBone(ply,"ValveBiped.Bip01_Head1",Vector(ply.headup,ply.head2d,1),Vector(ply.maxup,0,0))
end
local function InitializeBoneDance(ply)
ply.x = 0
ply.lastTime = CurTime()
ply.up = true
ply.maxup = math.random(5,10)
ply.maxdown = math.random(-5,0)
ply.headup = math.random(0.5,3)
ply.head2d = math.random(0.2,3)
ply.changed = true
JboneGo(ply)
end
local function GetBoneTarget()
local players = {}
for i,v in pairs(player.GetAll()) do
if LocalPlayer() != v and CanSee(LocalPlayer(),v:GetPos()+Vector(0,0,30)) then
table.insert(players,v)
end
end

if #players <= 0 then return end
local target = table.Random(players)
InitializeBoneDance(target)
end
local function DissableBoneDrug()
for i,v in pairs(player.GetAll()) do
if v.changed!= nil and v.changed == true then
v.changed = false
JBone(v,"ValveBiped.Bip01_Head1",Vector(1,1,1),Vector(0,0,0))
end
end
end
/*
---------------------------------------------------------------------------------
PP Drugs
---------------------------------------------------------------------------------
*/
hook.Add('HUDPaint','DrawPPdrugs',function()
-- if !LocalPlayer().HaveDrugs then return end
--if !DrawDrugMotion then return end
local brght = 0
if TGKlevel > 0.4 then
brght = -0.04
if TGKlevel > 1 then
brght = -0.04 - TGKlevel/5
end
end

local tab = {}
tab[ "$pp_colour_addr" ] =0
tab[ "$pp_colour_addg" ] = 0
tab[ "$pp_colour_addb" ] = 0
tab[ "$pp_colour_brightness" ] = brght
tab[ "$pp_colour_contrast" ] = 1.35
tab[ "$pp_colour_colour" ] = math.Clamp(TGKlevel*5,1,5)
tab[ "$pp_colour_mulr" ] =0
tab[ "$pp_colour_mulg" ] = 0
tab[ "$pp_colour_mulb" ] = 0
DrawColorModify( tab )

if TGKlevel < 0.2 then return end
DrawSobel( math.Clamp(1-TGKlevel,0.1,1))
if TGKlevel < 0.8 then return end
if SharpenShitUp then
SharpenShit = SharpenShit + 0.06
if SharpenShit > 5 then
SharpenShitUp = false
end
else
SharpenShit = SharpenShit - 0.06
if SharpenShit < -5 then
SharpenShitUp = true
end
end
DrawSharpen( 1,SharpenShit)
end)
/*
---------------------------------------------------------------------------------
Z0r.de
---------------------------------------------------------------------------------
*/
local pos = Vector(0,0,0)
local ang = Angle(0,0,0)
local width = 800
local height = 600
local scale = 0.125
local url = "http://z0r.de"
local function DrugTV()
pos = LocalPlayer():GetEyeTrace().HitPos + LocalPlayer():GetRight()*-40
pos.z = LocalPlayer():GetPos().z + 5
ang = LocalPlayer():GetAngles() +Angle(-90,-90,0)
ang.p = 0

if browser and browser:IsValid() then browser:Remove() end
browser = vgui.Create("HTML")
browser:SetPaintedManually(true)
browser:SetSize(width, height)
browser:SetMouseInputEnabled(false)
browser:OpenURL(url)
end

local function DeleteDrugTV()
if browser and browser:IsValid() then browser:Remove() end
end


local function DrawSign()
if browser and browser:IsValid() then
browser:UpdateHTMLTexture()
local a = browser:GetHTMLMaterial()
if a == nil then return end
if TGKlevel < 0.4 then DeleteDrugTV() return end
render.SetMaterial(a)
render.DrawQuad(Vector(0, 100, 0),
Vector(width, 50, 0),
Vector(width, height, 0),
Vector(220, height, 0))
end
end
hook.Add("RenderScreenspaceEffects", "3DHTMLSignDrugMod", function()
cam.Start3D(EyePos(), EyeAngles())
cam.Start3D2D(pos, ang, scale)
DrawSign()
cam.End3D2D()
end)
/*
---------------------------------------------------------------------------------
Drug Phrases
---------------------------------------------------------------------------------
*/
local function SayDrugPhrase()
local text = table.Random(CDrugs.Phrases)
RunConsoleCommand('say',text)
end
/*
---------------------------------------------------------------------------------
Weapons color
---------------------------------------------------------------------------------
*/

local function FunnyWeapons()
if not LocalPlayer().HaveDrugs then return end
for i,ply in pairs(player.GetAll()) do
ply:GetActiveWeapon().lastTime = CurTime()
ply:GetActiveWeapon().DrawWorldModel = function(self)
self:DrawModel()
if not LocalPlayer().HaveDrugs then self:SetMaterial("") self:SetColor(Color(255,255,255)) self.DrawWorldModel = function(self) self:DrawModel() end return end
if ply:GetActiveWeapon().lastTime + 0.3 > CurTime() then return end
LocalPlayer():GetActiveWeapon().lastTime = CurTime()
-- self:SetModel("models/weapons/w_stunbaton.mdl")
self:SetColor(Color(math.random(1,255),math.random(1,255),math.random(1,255)))
self:SetMaterial("models/shiny")
end
end
end
--FunnyWeapons()
/*
---------------------------------------------------------------------------------
Sounds
---------------------------------------------------------------------------------
*/
local Sounds = {}
Sounds["/custom_drug/smeh1.mp3"] = true
Sounds["/custom_drug/smeh2.mp3"] = true
local lastSound = CurTime()
local function EmitDrugSound()
if lastSound + 0.6 > CurTime() then return end
lastSound = CurTime()
local x,sound = table.Random(Sounds)
LocalPlayer():EmitSound(sound,100,80,1,6)
end
local function StopChannel0(chan)
local sound ="/custom_drug/chan0.mp3"
LocalPlayer():EmitSound(sound,100,80,1,0)
LocalPlayer():EmitSound(sound,100,80,1,1)

if chan == 1 then
EmitDrugSound()
end
end
local SoundMask = {}
SoundMask[1] = "bullet"
SoundMask[2] = "weapon"
SoundMask[3] = "shoot"
SoundMask[4] = "Weapon"
SoundMask[5] = "Single"
local function CheckSound(str)
local res = false
for i,v in pairs(SoundMask) do
if string.find(str,v) then
res = true
break
end
end
return res
end
hook.Add( "EntityEmitSound", "CustomHappyDrug", function(t)
if not LocalPlayer().HaveDrugs then return end
if TGKlevel < 0.3 then return end
t.Volume = 1
t.SoundLevel = 100
if math.random(1,3) == 2 then
t.Pitch = 60
else
t.Pitch = 200
end
if string.find(t.OriginalSoundName, "chan0.mp3") then
t.Volume = 1
t.SoundLevel = 100
elseif t.Channel == 0 or t.Channel == 1 and Sounds[t.OriginalSoundName] == nil then
if not string.find(t.OriginalSoundName, "smoke.mp3") then
t.Volume = 0
StopChannel0(t.Channel)
end
else

end

-- if t.Channel != 0 && not string.find(t.OriginalSoundName, "chan0.mp3") then PrintTable(t) end

return true
end )
local function DissableAllDrugs()
DissableBoneDrug()
DissableSkins()
DeleteDrugTV()
LocalPlayer().HaveDrugs = false
TGKlevel = 0
DrawDrugMotion = false
end
local DrugsEffects = {}
DrugsEffects[1] = FunnyWeapons
--DrugsEffects[2] = GetBoneTarget
DrugsEffects[3] = FunnySkins
DrugsEffects[4] = SayDrugPhrase
DrugsEffects[5] = DrugTV

local drugTime = CurTime()
local function SmokeAgain(level)
LocalPlayer().HaveDrugs = true
TGKlevel = TGKlevel + level
drugTime = CurTime() + CDrugs.Time
DrawDrugMotion = true
TGKlevel = math.Clamp(TGKlevel,0,1)
if TGKlevel > 0.1 && TGKlevel < 0.6 then
local r = math.random(1,3)
if r == 2 then
DrugsEffects[4]()
end
end

if TGKlevel > 0.2 then
local r = math.random(1,3)
if r == 2 then
DrugsEffects[1]()
end
end

--if TGKlevel > 0.3 then
-- local r = math.random(1,3)
-- if r == 2 then
-- DrugsEffects[2]()
-- end
--end

if TGKlevel > 0.5 then
local r = math.random(1,3)
if r == 2 then
DrugsEffects[3]()
end
end

if TGKlevel > 0.7 then
local r = math.random(1,3)
if r == 2 then
DrugsEffects[5]()
end
end

end
concommand.Add('testshit',function()
DrugsEffects[5]()
end)
net.Receive('drug_smokemo',function()
local level = net.ReadFloat()
SmokeAgain(level)
end)
--SmokeAgain(1)
--DrugsEffects[5]()
hook.Add('Think','StopDrugsBitch',function()
if not LocalPlayer():Alive() && TGKlevel > 0 then DissableAllDrugs() end
if LocalPlayer().HaveDrugs && CurTime() > drugTime then
drugTime = CurTime() + CDrugs.Time
TGKlevel = TGKlevel - 0.1
if TGKlevel <= 0 then
DissableAllDrugs()
end
end
end)
end
if SERVER then
function rasDvaTri()
return true
end
end
[/HIDE]
Взятый из другого аддона скупщик.
 

Nyyy

Пользователь
Регистрация
16 Дек 2017
Сообщения
12
Реакции
0
Баллы
13
Возраст
24
Пол
Попробуй найти по названию "itemstore shop"
 
Назад
Сверху Снизу