money printers in dark rp!

I would be happy if anyone could code a printer for me so the printer stores the money it prints and u can withdraw the money by clicking E on it.

Cool copy of gangwars here but I am 100% positive I can do this.

Add me on steam: modegg

I’ll send you WORKING code for this tomorrow.


INB4 King/Queen Flawless Posts To Try And Put Me Down

[editline]14th March 2011[/editline]

If you ain’t copying gangwars ok, they don’t own the idea so I’ll do it.

Dont worry, King flawless got a ban he deserved.

Yes but he made an alt account.

INB4 RTM fails to make it

[editline]15th March 2011[/editline]

Without ripping someone else’s code and taking credit

As I said.

Won’t be ripped and will work 100%

I made one if you want it, here’s a pic:

http://cloud.steampowered.com/ugc/578916639660217496/4139BEDD3E6DB1185AB8B93667D2E5DFB3A3C729/

That’s the old darkrp ain’t it??

I don’t see how that would matter if it was

Cause the codes are different.

The new ones use 3D2D and a few other changes.

Thats the client side part of the entity, and has nothing to do with the code, that stores/outputs the money.

and please define “a few other changes” to me, cause i would like to know what they are.

Because a few tiny changes mean that it wont work?

Queen. Please just leave the thread of post what he is asking for.

None of your posts are of a use to this guy so please just help or go

Do you know how to Lua script anyway?

Whats lua?

Think that’s what you’re after

That aint it.

Just testing my code now.

How ever not?
He wants it to store money that is printed. My mod includes this, does it not?

I think you will find it does.

He wants the printer to store it. not a seperate thing.

[editline]15th March 2011[/editline]

Done.

http://dl.dropbox.com/u/8718166/gm_construct0026.jpg

http://dl.dropbox.com/u/8718166/gm_construct0027.jpg

DarkRP/entities/entities/money_printer/cl_init
[lua]include(“shared.lua”)

function ENT:Initialize()
end

function ENT:Draw()
self.Entity:DrawModel()

local Pos = self:GetPos()
local Ang = self:GetAngles()

local owner = self.dt.owning_ent
owner = (ValidEntity(owner) and owner:Nick()) or "unknown"
amount = self:GetDTInt(0) or 0

surface.SetFont("HUDNumber5")
local TextWidth = surface.GetTextSize("Money printer")
local TextWidth2 = surface.GetTextSize(owner)
local TextWidth3 = surface.GetTextSize("Contains: $"..amount)

Ang:RotateAroundAxis(Ang:Up(), 90)

cam.Start3D2D(Pos + Ang:Up() * 11.5, Ang, 0.11)
	draw.WordBox(2, -TextWidth*0.5, -30, "Money printer", "HUDNumber5", Color(140, 0, 0, 100), Color(255,255,255,255))
	draw.WordBox(2, -TextWidth2*0.5, 18, owner, "HUDNumber5", Color(140, 0, 0, 100), Color(255,255,255,255))
	draw.WordBox(2, -TextWidth3*0.5, 66, "Contains: $"..amount, "HUDNumber5", Color(140, 0, 0, 100), Color(255,255,255,255))
cam.End3D2D()

end

function ENT:Think()
end[/lua]

DarkRP/entities/entities/money_printer/init
[lua]-- RRPX Money Printer reworked for DarkRP by philxyz
AddCSLuaFile(“cl_init.lua”)
AddCSLuaFile(“shared.lua”)
include(“shared.lua”)

local PrintMore
function ENT:Initialize()
self:SetModel(“models/props_c17/consolebox01a.mdl”)
self:PhysicsInit(SOLID_VPHYSICS)
self:SetMoveType(MOVETYPE_VPHYSICS)
self:SetSolid(SOLID_VPHYSICS)
self:SetUseType(SIMPLE_USE)
local phys = self:GetPhysicsObject()
if phys:IsValid() then phys:Wake() end
self.sparking = false
self.damage = 100
self.IsMoneyPrinter = true
timer.Simple(27, PrintMore, self)
self:SetDTInt(0,0)
end

function ENT:OnTakeDamage(dmg)
if self.burningup then return end

self.damage = (self.damage or 100) - dmg:GetDamage()
if self.damage <= 0 then
	local rnd = math.random(1, 10)
	if rnd < 3 then
		self:BurstIntoFlames()
	else
		self:Destruct()
		self:Remove()
	end
end

end

function ENT:Destruct()
local vPoint = self:GetPos()
local effectdata = EffectData()
effectdata:SetStart(vPoint)
effectdata:SetOrigin(vPoint)
effectdata:SetScale(1)
util.Effect(“Explosion”, effectdata)
Notify(self.dt.owning_ent, 1, 4, “Your money printer has exploded!”)
end

function ENT:BurstIntoFlames()
Notify(self.dt.owning_ent, 0, 4, “Your money printer is overheating!”)
self.burningup = true
local burntime = math.random(8, 18)
self:Ignite(burntime, 0)
timer.Simple(burntime, self.Fireball, self)
end

function ENT:Fireball()
if not self:IsOnFire() then self.burningup = false return end
local dist = math.random(20, 280) – Explosion radius
self:Destruct()
for k, v in pairs(ents.FindInSphere(self:GetPos(), dist)) do
if not v:IsPlayer() and not v.IsMoneyPrinter then v:Ignite(math.random(5, 22), 0) end
end
self:Remove()
end

PrintMore = function(ent)
if ValidEntity(ent) then
ent.sparking = true
timer.Simple(3, ent.CreateMoneybag, ent)
end
end

function ENT:CreateMoneybag()
if not ValidEntity(self) then return end
if self:IsOnFire() then return end
local MoneyPos = self:GetPos()

if math.random(1, 22) == 3 then self:BurstIntoFlames() end

local amount = GetConVarNumber("mprintamount")
if amount == 0 then
	amount = 250
end
self.sparking = false
self:SetDTInt(0, self:GetDTInt(0) + amount )

timer.Simple(math.random(100, 350), PrintMore, self)

end

function ENT:Think()
if not self.sparking then return end

local effectdata = EffectData()
effectdata:SetOrigin(self:GetPos())
effectdata:SetMagnitude(1)
effectdata:SetScale(1)
effectdata:SetRadius(2)
util.Effect("Sparks", effectdata)

end

function ENT:Use( activator, caller )
local amount = self:GetDTInt(0)
if amount != 0 then
activator:AddMoney(amount or 0)
Notify(activator, 0, 4, "You have recovered " … CUR … (self:GetDTInt(0) or 0) … “!”)
self:SetDTInt(0,0)
end
end
[/lua]

100% Working and tested. 100% Modified by me.

[editline]15th March 2011[/editline]

Fixed the misalignment of the “Contains: $…”

Where did you rip that from?

Funny guy.

Google, Yahoo, Facepunch, what ever.

You wont find the code anywhere but here, cause i made it myself.