RadioMod help...

Hello, i started using RadioMod addon, replaced the default songs with my own songs, but it’s still playing the default songs… why?

Also, why is this —> http://aijaa.com/mRwNAi happening? It should only show NadioMod, but it’s also showing RadioMod…

Why don’t you ask the author instead ?
Also you really think that we’ll be able to find the issue without looking onto code, just the picture ?

cl_init.lua:


include('shared.lua')

function ENT:Initialize()
end

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

 function DrawInfoOldRadio()
	local tr = LocalPlayer():GetEyeTrace()
	if IsValid(tr.Entity) and tr.Entity:GetPos():Distance(LocalPlayer():GetPos()) < 400 then
		if tr.Entity:GetClass() == "radio" then
			local ent = tr.Entity
			local pos = ent:GetPos()

			pos.z = pos.z + 8
			pos = pos:ToScreen()

			local owner = ""
			if IsValid(ent:GetNWEntity("owning_ent")) then
				owner = ent:GetNWEntity("owning_ent"):Nick()
			end
			local text2 = owner .. ""
			local text = owner ..  ""

			draw.DrawText(text, "TargetID", pos.x + 1, pos.y + 17, Color(255, 150, 0, 200), 1)
			draw.DrawText(text2, "TargetID", pos.x, pos.y, Color(255, 150, 0, 200), 1)
		end
	end
end
hook.Add( "HUDPaint", "DrawInfoOldRadio", DrawInfoOldRadio ) 

init.lua:



AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include('shared.lua')

--Musique de la radio
ENT.RadioSong1 = NULL
ENT.RadioSong2 = NULL
ENT.RadioSong3 = NULL
ENT.RadioSong4 = NULL


ENT.SongNr = 0
ENT.NxtDelay = CurTime()

function ENT:SpawnFunction(ply, tr)

	if (!tr.Hit) then return end
	
	local SpawnPos = tr.HitPos + tr.HitNormal * 16
	
	local ent = ents.Create("radio")
		ent:SetPos(SpawnPos)
	ent:Spawn()
	ent:Activate()
	
	return ent
end

function ENT:Initialize( )
	self:SetModel( "models/clutter/radio.mdl" )

	self:PhysicsInit( SOLID_VPHYSICS )
	self:SetMoveType( MOVETYPE_VPHYSICS )
	self:SetSolid( SOLID_VPHYSICS )

    local phys = self:GetPhysicsObject()
	if(phys:IsValid()) then phys:Wake() end

	self.Engine = NULL

    self.RadioSong1 = CreateSound(self.Entity,"[xr]/1.mp3")
    self.RadioSong2 = CreateSound(self.Entity,"[xr]/2.mp3")
    self.RadioSong3 = CreateSound(self.Entity,"[xr]/3.mp3")
    self.RadioSong4 = CreateSound(self.Entity,"[xr]/4.mp3")




end

function ENT:Use(activator, caller)
	if self.NxtDelay < CurTime() then
	self.NxtDelay = CurTime()+0.5
	self.SongNr = self.SongNr + 1
		self.Entity:EmitSound("[XR]/radio_select.wav", 100, 100)

			if self.SongNr >26 then
			self.SongNr = 0
			self.Entity:EmitSound("[XR]/radio_off.wav", 100, 100)
			end

	end
end

function ENT:Think()

if self.Entity:WaterLevel() > 0 then

		local effectdata = EffectData()
		effectdata:SetOrigin( self.Entity:GetPos())
		effectdata:SetStart(Vector(0,0,2)) 
		util.Effect( "PropellerBubbles", effectdata )
end

if self.SongNr == 1 then
	self.RadioSong1:Play()
end

if self.SongNr == 2 then
	self.RadioSong1:Stop()
	self.RadioSong2:Play()
end

if self.SongNr == 3 then
	self.RadioSong1:Stop()
	self.RadioSong2:Stop()
	self.RadioSong3:Play()
end

if self.SongNr == 4 then
	self.RadioSong1:Stop()
	self.RadioSong2:Stop()
	self.RadioSong3:Stop()
	self.RadioSong4:Play()
end


Stop throwing code at us and expecting us to fix it for you.

Oh my fucking god…

The menu isn’t even in that code… That’s just the entity…

What menu? They are all lua files in that addon…

This

Also, why is this —> http://aijaa.com/mRwNAi happening? It should only show NadioMod, but it’s also showing RadioMod…

You had an issue with the menu (aka with showing RadioMod as well). Post that too.

RadioMod was outdated, and not working like it should anymore. Now my only problem is the default songs… >_>


--Musique de la radio
ENT.RadioSong1 = NULL
ENT.RadioSong2 = NULL
ENT.RadioSong3 = NULL
ENT.RadioSong4 = NULL

I assume you changed that, yes?

Well if that is still not changing it, change these:


self.RadioSong1 = CreateSound(self.Entity,"[xr]/1.mp3")
    self.RadioSong2 = CreateSound(self.Entity,"[xr]/2.mp3")
    self.RadioSong3 = CreateSound(self.Entity,"[xr]/3.mp3")
    self.RadioSong4 = CreateSound(self.Entity,"[xr]/4.mp3")


As you can see there those are the radio songs, they’re calling upon the files that chances are, are already there. So rename those to your new songs.

Already did.

Even the second part? Where it’s literally on initialization setting the song files to 1, 2, 3 and 4?

Yes. I have 1.mp3, 2.mp3, 3.mp3 and 4.mp3 in [xr] folder.

No no no, have your song files in that folder, but rename the numbers in the code, so for example:


self.RadioSong1 = CreateSound(self.Entity,"[xr]/1.mp3")

to


self.RadioSong1 = CreateSound(self.Entity,"[xr]/someshittymusicprobablyrobzombieforendround.mp3")

I did that, but now it’s giving me error in console: ‘end’ expected (to close ‘function’ at line 66) near ‘<eof>’

Show me the code now

Edit:

That also means you edited something else, not just the names.

Repaired it somehow lol

O.k… So it works now?..

Well, no errors… But still those shitty default songs…

Impossible, unless there is code you aren’t showing us.