انا سويت مثال و ما جربته
يا رب يشتغل
ملاحظة يفتح من
فى اف 8
o يفتح
e يغلق
GUIEditor = {
button = {},
window = {},
edit = {}
}
addEventHandler("onClientResourceStart", resourceRoot,
function()
GUIEditor.window[1] = guiCreateWindow(532, 164, 249, 173, "Sound", false)
guiWindowSetSizable(GUIEditor.window[1], false)
E1 = guiCreateEdit(9, 30, 230, 30, "url", false, GUIEditor.window[1])
B1 = guiCreateButton(9, 66, 113, 29, "Play", false, GUIEditor.window[1])
guiSetProperty(B1, "NormalTextColour", "FFAAAAAA")
B2 = guiCreateButton(126, 66, 113, 29, "Stop", false, GUIEditor.window[1])
guiSetProperty(B2, "NormalTextColour", "FFAAAAAA")
E2 = guiCreateEdit(67, 101, 104, 26, "Volume", false, GUIEditor.window[1])
guiSetProperty(E2, "NormalTextColour", "FFFF9C00")
B3 = guiCreateButton(69, 131, 102, 32, "Set", false, GUIEditor.window[1])
guiSetProperty(B3, "NormalTextColour", "FFAAAAAA")
end
)
s = guiGetText(E1)
v = guiGetText(E2)
addEventHandler("onClientGUIClick",root,
function ()
if source == B1 then
sound = playSound(s)
end
end
)
addEventHandler("onClientGUIClick",root,
function ()
if source == B2 then
stopSound( sound )
end
end
)
addEventHandler("onClientGUIClick",root,
function ()
if source == B2 then
setSoundVolume(sound, v)
end
end
)
function o()
guiSetVisible(GUIEditor.window[1],true)
showCursor( true )
guiSetInputEnabled( true )
end
addCommandHandler("o",o)
function e()
guiSetVisible(GUIEditor.window[1],false)
showCursor( false )
guiSetInputEnabled( false )
end
addCommandHandler("e",e)