Yet again another Facepunch help post. I'm having this problem as to where when I get the money printers installed and there fine and everything they work when I buy them. But when I press E on them when it has money in it. It doesn't work. There is one console error every time I press e on it. I copied the error from the server to help. I will also put my addentities.lua down there. Help is greatly and strongly appreciated. Thanks for at least reading :).
Server Error:
[QUOTE][DarkRP Special Money Printers] lua/entities/nuclear_money_printer/init.lua:74:
attempt to call method 'AddMoney' (a nil value)
1. unknown - lua/entities/nuclear_money_printer/init.lua:74[/QUOTE]
Addentities.lua:
[QUOTE]AddCustomShipment("Desert eagle", {
model = "models/weapons/w_pist_deagle.mdl",
entity = "weapon_real_cs_desert_eagle",
price = 3500,
amount = 10,
seperate = false,
pricesep = nil,
noship = false,
allowed = {TEAM_GUN}
})
AddCustomShipment("Five-seven", {
model = "models/weapons/w_pist_fiveseven.mdl",
entity = "weapon_real_cs_five-seven",
price = 2250,
amount = 10,
seperate = false,
pricesep = nil,
noship = false,
allowed = {TEAM_GUN}
})
AddCustomShipment("Glock", {
model = "models/weapons/w_pist_glock18.mdl",
entity = "weapon_real_cs_glock18",
price = 2250,
amount = 10,
seperate = false,
pricesep = nil,
noship = false,
allowed = {TEAM_GUN}
})
AddCustomShipment("P228", {
model = "models/weapons/w_pist_p228.mdl",
entity = "weapon_real_cs_p228",
price = 2500,
amount = 10,
seperate = false,
pricesep = nil,
noship = false,
allowed = {TEAM_GUN}
})
AddCustomShipment("AK47", {
model = "models/weapons/w_rif_ak47.mdl",
entity = "weapon_real_cs_ak47",
price = 7500,
amount = 10,
seperate = false,
pricesep = nil,
noship = false,
allowed = {TEAM_GUN}
})
AddCustomShipment("MP5", {
model = "models/weapons/w_smg_mp5.mdl",
entity = "weapon_real_cs_mp5a5",
price = 5500,
amount = 10,
seperate = false,
pricesep = nil,
noship = false,
allowed = {TEAM_GUN}
})
AddCustomShipment("M4a1", {
model = "models/weapons/w_rif_m4a1.mdl",
entity = "weapon_real_cs_m4a1",
price = 7000,
amount = 10,
seperate = false,
pricesep = nil,
noship = false,
allowed = {TEAM_GUN}
})
AddCustomShipment("Mac 10", {
model = "models/weapons/w_smg_mac10.mdl",
entity = "weapon_real_cs_mac10",
price = 4500,
amount = 10,
seperate = false,
pricesep = nil,
noship = false,
allowed = {TEAM_GUN}
})
AddCustomShipment("AWP", {
model = "models/weapons/w_snip_awp.mdl",
entity = "weapon_real_cs_awp",
price = 13500,
amount = 10,
seperate = false,
pricesep = nil,
noship = false,
allowed = {TEAM_GUN}
})
AddCustomShipment("Scout", {
model = "models/weapons/w_snip_scout.mdl",
entity = "weapon_real_cs_scout",
price = 11500,
amount = 10,
seperate = false,
pricesep = nil,
noship = false,
allowed = {TEAM_GUN}
})
AddCustomShipment("g3sg1", {
model = "models/weapons/w_snip_g3sg1.mdl",
entity = "weapon_real_cs_g3sg1",
price = 10000,
amount = 10,
seperate = false,
pricesep = nil,
noship = false,
allowed = {TEAM_GUN}
})
AddCustomShipment("SiG-552", {
model = "models/weapons/w_rif_sg552.mdl",
entity = "weapon_real_cs_sg552",
price = 12500,
amount = 10,
seperate = false,
pricesep = nil,
noship = false,
allowed = {TEAM_GUN}
})
AddCustomShipment("SG-550 Commando", {
model = "models/weapons/w_snip_sg550.mdl",
entity = "weapon_real_cs_sg550",
price = 13000,
amount = 10,
seperate = false,
pricesep = nil,
noship = false,
allowed = {TEAM_GUN}
})
AddCustomShipment("Famas", {
model = "models/weapons/w_rif_famas.mdl",
entity = "weapon_real_cs_famas",
price = 7000,
amount = 10,
seperate = false,
pricesep = nil,
noship = false,
allowed = {TEAM_GUN}
})
AddCustomShipment("M249", {
model = "models/weapons/w_mach_m249para.mdl",
entity = "weapon_real_cs_m249",
price = 13500,
amount = 10,
seperate = false,
pricesep = nil,
noship = false,
allowed = {TEAM_GUN}
})
AddCustomShipment("Galil", {
model = "models/weapons/w_rif_galil.mdl",
entity = "weapon_real_cs_galil",
price = 7500,
amount = 10,
seperate = false,
pricesep = nil,
noship = false,
allowed = {TEAM_GUN}
})
AddCustomShipment("UMP-45", {
model = "models/weapons/w_smg_ump45.mdl",
entity = "weapon_real_cs_ump_45",
price = 6000,
amount = 10,
seperate = false,
pricesep = nil,
noship = false,
allowed = {TEAM_GUN}
})
AddCustomShipment("P90", {
model = "models/weapons/w_smg_p90.mdl",
entity = "weapon_real_cs_p90",
price = 7500,
amount = 10,
seperate = false,
pricesep = nil,
noship = false,
allowed = {TEAM_GUN}
})
AddCustomShipment("Flash Grenade", {
model = "models/weapons/w_eq_flashbang.mdl",
entity = "weapon_real_cs_flash",
price = 12000,
amount = 10,
seperate = false,
pricesep = nil,
noship = false,
allowed = {TEAM_BMD}
})
AddCustomShipment("Usp.45", {
model = "models/weapons/w_pist_usp.mdl",
entity = "weapon_real_cs_usp",
price = 2500,
amount = 10,
seperate = false,
pricesep = nil,
noship = false,
allowed = {TEAM_GUN}
})
AddCustomShipment("Knives", {
model = "models/weapons/w_knife_ct.mdl",
entity = "weapon_real_cs_knife",
price = 1000,
amount = 1,
seperate = false,
pricesep = nil,
noship = false,
allowed = {TEAM_BMD}
})
AddEntity("Drug lab", {
ent = "drug_lab",
model = "models/props_lab/crematorcase.mdl",
price = 1000,
max = 3,
cmd = "/buydruglab",
allowed = {TEAM_DRUG}
})
AddEntity("Gun lab", {
ent = "gunlab",
model = "models/props_c17/TrapPropeller_Engine.mdl",
price = 1000,
max = 1,
cmd = "/buygunlab",
allowed = {TEAM_GUN}
})
AddEntity("Topaz Printer", {
ent = "topaz_money_printer",
model = "models/props_c17/consolebox01a.mdl",
price = 1000,
max = 2,
cmd = "/buytopaz"
})
AddEntity("Amethyst Printer", {
ent = "amethyst_money_printer",
model = "models/props_c17/consolebox01a.mdl",
price = 1500,
max = 2,
cmd = "/buyamethyst"
})
AddEntity("Emerald Printer", {
ent = "emerald_money_printer",
model = "models/props_c17/consolebox01a.mdl",
price = 2500,
max = 2,
cmd = "/buyemerald"
})
AddEntity("Ruby Printer", {
ent = "ruby_money_printer",
model = "models/props_c17/consolebox01a.mdl",
price = 5000,
max = 2,
cmd = "/buyruby"
})
AddEntity("Sapphire Printer", {
ent = "sapphire_money_printer",
model = "models/props_c17/consolebox01a.mdl",
price = 7500,
max = 2,
cmd = "/buysapphire"
})
AddEntity("Nuclear Money printer", "nuclear_money_printer", "models/props_lab/reciever01a.mdl", 8000, 1, "/buymoneyprinter1")
AddEntity("Golden Money printer", "gold_money_printer", "models/props_c17/consolebox01a.mdl", 4000, 2, "/buymoneyprinter2")
AddEntity("Ruby Money printer", "ruby_money_printer", "models/props_c17/consolebox01a.mdl", 2000, 3, "/buymoneyprinter3")
-- ADD CUSTOM SHIPMENTS HERE(next line): ############################################################################################################################################################################################
AddEntity("Armor Dispenser", {
ent = "item_suitcharger",
model = "models/props_combine/suit_charger001.mdl",
price = 3000,
max = 2,
cmd = "/buyarmordisp",
allowed
msg me on steam i might be able to help about the money printers my steam name is mdahitman i have a rockstar logo as a profile pic
It's addMoney not AddMoney
[url]www.darkrp.com[/url] ;)
Other than that, you shouldn't start modifying the old DarkRP now, as DarkRP 2.5.0 will come out 4th October. Check [url]http://forum.darkrp.com/threads/darkrp-2-5-0-will-be-released-4th-october.29/[/url]
[QUOTE=ms333;42083955]It's addMoney not AddMoney[/QUOTE]
Where can I change that
Go here lua/entities/nuclear_money_printer/init.lua:74 and change AddMoney to addMoney... if you can't fix that simple error why the hell do run a gamemode as simple as darkrp and you still can't manage it.
[QUOTE=ds;42089239]Go here lua/entities/nuclear_money_printer/init.lua:74 and change AddMoney to addMoney... if you can't fix that simple error why the hell do run a gamemode as simple as darkrp and you still can't manage it.[/QUOTE]
I did that. then after I did that theres another error with the notify thing. Here it is.
[QUOTE][ERROR] addons/darkrp special money printers/lua/entities/nuclear_money_printer/
init.lua:75: attempt to call method 'notify' (a nil value)
1. unknown - addons/darkrp special money printers/lua/entities/nuclear_money_p
rinter/init.lua:75[/QUOTE]
[editline]5th September 2013[/editline]
[QUOTE=ds;42089239]Go here lua/entities/nuclear_money_printer/init.lua:74 and change AddMoney to addMoney... if you can't fix that simple error why the hell do run a gamemode as simple as darkrp and you still can't manage it.[/QUOTE]
And also heres the whole init file:
AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include("shared.lua")
local PrintMore
function ENT:Initialize()
self:SetModel("models/props_lab/reciever01a.mdl")
self:PhysicsInit(SOLID_VPHYSICS)
self:SetMoveType(MOVETYPE_VPHYSICS)
self:SetSolid(SOLID_VPHYSICS)
self:SetColor(Color(math.random(1, 255), math.random(1, 255), math.random(1,255), 255))
local phys = self:GetPhysicsObject()
if phys:IsValid() then phys:Wake() end
self.sparking = false
self.damage = 100
self.IsMoneyPrinter = true
timer.Simple(1.0, function() PrintMore(self) end)
self:SetNWInt("PrintA",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 < 6 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)
GAMEMODE:Notify(self.dt.owning_ent, 1, 4, "Your money printer has exploded!")
end
function ENT:BurstIntoFlames()
GAMEMODE:Notify(self.dt.owning_ent, 1, 4, "Your money printer is overheating!")
self.burningup = true
local burntime = math.random(8, 18)
self:Ignite(burntime, 0)
timer.Simple(burntime, function() self:Fireball() end)
end
function ENT:Fireball()
if not self:IsOnFire() then 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 IsValid(ent) then
ent.sparking = true
timer.Simple(1.0, function() ent:CreateMoneybag() end)
end
end
function ENT:Use(activator)
if(activator:IsPlayer()) and self:GetNWInt("PrintA") >= 1 then
activator:addMoney(self:GetNWInt("PrintA"));
GAMEMODE:Notify(activator, 1, 4, "You have collected $"..self:GetNWInt("PrintA").." from a NuClEaR Printer.")
self:SetNWInt("PrintA",0)
end
end
function ENT:CreateMoneybag()
if not IsValid(self) then return end
if self:IsOnFire() then return end
local MoneyPos = self:GetPos()
local X = 22
local Y = math.random(16, 32)
local amount = self:GetNWInt("PrintA") + Y
self:SetNWInt("PrintA",amount)
self.sparking = false
timer.Simple(1.0, function() PrintMore(self) end)
end
[QUOTE=TheMcsickness;42090616]I did that. then after I did that theres another error with the notify thing. Here it is.
[editline]5th September 2013[/editline]
And also heres the whole init file:
AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include("shared.lua")
local PrintMore
function ENT:Initialize()
self:SetModel("models/props_lab/reciever01a.mdl")
self:PhysicsInit(SOLID_VPHYSICS)
self:SetMoveType(MOVETYPE_VPHYSICS)
self:SetSolid(SOLID_VPHYSICS)
self:SetColor(Color(math.random(1, 255), math.random(1, 255), math.random(1,255), 255))
local phys = self:GetPhysicsObject()
if phys:IsValid() then phys:Wake() end
self.sparking = false
self.damage = 100
self.IsMoneyPrinter = true
timer.Simple(1.0, function() PrintMore(self) end)
self:SetNWInt("PrintA",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 < 6 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)
GAMEMODE:Notify(self.dt.owning_ent, 1, 4, "Your money printer has exploded!")
end
function ENT:BurstIntoFlames()
GAMEMODE:Notify(self.dt.owning_ent, 1, 4, "Your money printer is overheating!")
self.burningup = true
local burntime = math.random(8, 18)
self:Ignite(burntime, 0)
timer.Simple(burntime, function() self:Fireball() end)
end
function ENT:Fireball()
if not self:IsOnFire() then 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 IsValid(ent) then
ent.sparking = true
timer.Simple(1.0, function() ent:CreateMoneybag() end)
end
end
function ENT:Use(activator)
if(activator:IsPlayer()) and self:GetNWInt("PrintA") >= 1 then
activator:addMoney(self:GetNWInt("PrintA"));
GAMEMODE:Notify(activator, 1, 4, "You have collected $"..self:GetNWInt("PrintA").." from a NuClEaR Printer.")
self:SetNWInt("PrintA",0)
end
end
function ENT:CreateMoneybag()
if not IsValid(self) then return end
if self:IsOnFire() then return end
local MoneyPos = self:GetPos()
local X = 22
local Y = math.random(16, 32)
local amount = self:GetNWInt("PrintA") + Y
self:SetNWInt("PrintA",amount)
self.sparking = false
timer.Simple(1.0, function() PrintMore(self) end)
end[/QUOTE]
Just download the SVN: [url]https://github.com/dkoz/gsprinters[/url]
open the map and go to branches
use the beta map for the printers
this work!
Sorry, you need to Log In to post a reply to this thread.