Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --init.lua
- AddCSLuaFile("cl_init.lua");
- AddCSLuaFile("shared.lua");
- include("shared.lua");
- function ENT:Initialize()
- self:SetModel("models/w_models/weapons/w_eq_painpills.mdl");
- self:PhysicsInit(SOLID_VPHYSICS);
- self:SetMoveType(MOVETYPE_VPHYSICS);
- self:SetSolid(SOLID_VPHYSICS);
- self:GetPhysicsObject():SetMass(10);
- self:GetPhysicsObject():SetVelocity((self:GetUp() * 2));
- self.jailWall = true;
- self.SetColor = (Color(15, 72, 217, 255));
- end;
- function ENT:OnTakeDamage(dmginfo)
- self:Remove();
- end;
- function ENT:SalePrice(activator)
- return math.random(math.Round(self:Getprice() / 8), math.Round(self:Getprice() / 4))
- end
- function ENT:canUse(activator)
- if activator.maxDrugs and activator.maxDrugs >= GAMEMODE.Config.maxdrugs then
- DarkRP.notify(activator, 1, 3, DarkRP.getPhrase("limit", self.itemPhrase))
- return false
- end
- return true
- end
- function ENT:createItem(activator)
- local drugPos = self:GetPos()
- local drug = ents.Create("d_methadone_pill")
- drug:SetPos(Vector(drugPos.x, drugPos.y, drugPos.z + 35))
- drug:Setowning_ent(activator)
- drug.SID = activator.SID
- drug.nodupe = true
- drug:Setprice(self:Getprice() or self.initialPrice)
- drug:Spawn()
- if not activator.maxDrugs then
- activator.maxDrugs = 0
- end
- activator.maxDrugs = activator.maxDrugs + 1
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement