Ok, dass Problem ist bei meinem Fall nicht so wichtig !
Jetzt habe ich noch eine andere Frage, möchte aber kein neues Thema erstellen ..
Wenn ich das erste mal auf einen Button drücke, spielt er mir einen Stream ab, wenn ich ein 2. mal klicke, stop er den Sound, drücke ich dann auf irgendeinen x beliebigen Button kommt folgender Fehler:
newpermastream\Client.lua:80 bad Argument @ *stopSound* [ expected Sound at Argument 1 ]
Lua
local dxvar = 0
local r = 255
local g = 255
local b = 255
local rr = 255
local gg = 255
local bb = 255
local rr = 255
local gg = 255
local bb = 255
local rrr = 255
local ggg = 255
local bbb = 255
local rrrr = 255
local gggg = 255
local bbbb = 255
local rrrrr = 255
local ggggg = 255
local bbbbb = 255
local rrrrrr = 255
local gggggg = 255
local bbbbbb = 255
function dxDrawSound()
local sx,sy = guiGetScreenSize()
local px,py = 1680,1050
local x,y = (sx/px), (sy/py)
dxDrawRectangle(387, 255, 847, 482, tocolor(2, 1, 1, 255), true)
dxDrawImage(356, 232, 904, 524, ":images/rahmen.png", 0, 0, 0, tocolor(255, 255, 255, 255), true)
dxDrawText("Housetime", x*429, y*428, x*820, y*466, tocolor(r, g, b, 255), 1.50, "default-bold", "left", "center", false, false, true, false, false)
dxDrawText("Technobase", x*428, y*286, x*819, y*324, tocolor(rr, gg, bb, 255), 1.50, "default-bold", "left", "center", false, false, true, false, false)
dxDrawText("Trancebase", x*428, y*357, x*819, y*395, tocolor(rrr, ggg, bbb, 255), 1.50, "default-bold", "left", "center", false, false, true, false, false)
dxDrawText("Hardbase", x*429, y*531, x*820, y*569, tocolor(rrrr, gggg, bbbb, 255), 1.50, "default-bold", "left", "center", false, false, true, false, false)
dxDrawText("Coretime", x*429, y*604, x*820, y*642, tocolor(rrrrr, ggggg, bbbbb, 255), 1.50, "default-bold", "left", "center", false, false, true, false, false)
dxDrawText("Clubtime", x*429, y*672, x*820, y*710, tocolor(rrrrrr, gggggg, bbbbbb, 255), 1.50, "default-bold", "left", "center", false, false, true, false, false)
dxDrawImage(x*1065, y*286, x*67, y*55, ":images/streamicon.png", 0, 0, 0, tocolor(255, 255, 255, 255), true)
dxDrawImage(x*1065, y*351, x*67, y*55, ":images/streamicon.png", 0, 0, 0, tocolor(255, 255, 255, 255), true)
dxDrawImage(x*1065, y*416, x*67, y*55, ":images/streamicon.png", 0, 0, 0, tocolor(255, 255, 255, 255), true)
dxDrawImage(x*1065, y*522, x*67, y*55, ":images/streamicon.png", 0, 0, 0, tocolor(255, 255, 255, 255), true)
dxDrawImage(x*1065, y*587, x*67, y*55, ":images/streamicon.png", 0, 0, 0, tocolor(255, 255, 255, 255), true)
dxDrawImage(x*1065, y*652, x*67, y*55, ":images/streamicon.png", 0, 0, 0, tocolor(255, 255, 255, 255), true)
dxDrawImage(x*555, y*460, x*68, y*61, ":images/lauter.png", 0, 0, 0, tocolor(255, 255, 255, 255), true)
dxDrawImage(x*946, y*461, x*68, y*61, ":images/lauter.png", 0, 0, 0, tocolor(255, 255, 255, 255), true)
end
function bindings()
if dxvar == 0 then
addEventHandler("onClientRender", getRootElement(), dxDrawSound)
dxvar = 1
showCursor(true)
elseif dxvar == 1 then
removeEventHandler("onClientRender", getRootElement(), dxDrawSound)
dxvar = 0
showCursor(false)
end
end
bindKey("F2", "down", bindings)
local streamURL = ""
local sound
addEventHandler("onClientClick", getRootElement(), function(button, state)
if isMouseOverElement(1065, 286, 67, 55) and (state == "down" and button == "left")then
if not(sound) then
streamURL = "http://listen.housetime.fm/aacplus.pls"
sound = playSound(streamURL, true)
--infoshow("Du hörst nun Housetime !", 21, 55, 213)
rr = 0
gg = 255
bb = 20
else
stopSound(sound)
streamURL = ""
rr = 255
gg = 255
bb = 255
end
end
end)
addEventHandler("onClientClick", getRootElement(), function(button, state)
if isMouseOverElement(1065, 351, 67, 55) and (state == "down" and button == "left")then
if(sound) then
stopSound(sound)
streamURL = ""
rrr = 255
ggg = 255
bbb = 255
else
streamURL = "http://listen.technobase.fm/aacplus.pls"
sound = playSound(streamURL, true)
--infoshow("Du hörst nun Technobase !", 21, 55, 213)
rrr = 0
ggg = 255
bbb = 20
end
end
end)
addEventHandler("onClientClick", getRootElement(), function(button, state)
if isMouseOverElement(1065, 416, 67, 55) and (state == "down" and button == "left")then
if(sound) then
stopSound(sound)
streamURL = ""
r = 255
g = 255
b = 255
else
streamURL = "http://listen.trancebase.fm/aacplus.pls"
sound = playSound(streamURL, true)
--infoshow("Du hörst nun Trancebase !", 21, 55, 213)
r = 0
g = 255
b = 20
end
end
end)
addEventHandler("onClientClick", getRootElement(), function(button, state)
if isMouseOverElement(1065, 522, 67, 55) and (state == "down" and button == "left")then
if(sound) then
stopSound(sound)
streamURL = ""
rrrr = 255
gggg = 255
bbbb = 255
else
streamURL = "http://listen.hardbase.fm/aacplus.pls"
sound = playSound(streamURL, true)
--infoshow("Du hörst nun Hardbase !", 21, 55, 213)
rrrr = 0
gggg = 255
bbbb = 20
end
end
end)
addEventHandler("onClientClick", getRootElement(), function(button, state)
if isMouseOverElement(1065, 522, 67, 55) and (state == "down" and button == "left")then
if(sound) then
stopSound(sound)
streamURL = ""
rrrrr = 255
ggggg = 255
bbbbb = 255
else
streamURL = "http://listen.coretime.fm/aacplus.pls"
sound = playSound(streamURL, true)
--infoshow("Du hörst nun Coretime !", 21, 55, 213)
rrrrr = 0
ggggg = 255
bbbbb = 20
end
end
end)
addEventHandler("onClientClick", getRootElement(), function(button, state)
if isMouseOverElement(1065, 522, 67, 55) and (state == "down" and button == "left")then
if(sound) then
stopSound(sound)
streamURL = ""
rrrrrr = 255
gggggg = 255
bbbbbb = 255
else
streamURL = "http://listen.clubtime.fm/aacplus.pls"
sound = playSound(streamURL, true)
--infoshow("Du hörst nun Clubtime !", 21, 55, 213)
rrrrrr = 0
gggggg = 255
bbbbbb = 20
end
end
end)
function isMouseOverElement(psx,psy,pssx,pssy)
if isCursorShowing() == false then
return false
end
local x,y = guiGetScreenSize()
local cx,cy = getCursorPosition()
cx,cy = cx*x,cy*y
if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
return true,cx,cy
else
return false
end
end
Alles anzeigen