Hallo, liebe Community!
Ich habe ein Problem mit meinen Script, wenn /gun eingebe taucht das Fenster nicht auf.
Das Fenster erscheint nur wenn ich die Resource starte.Die Bilder sind ebenfalls nicht da.
Hier das Script:
Lua
Waffen = {
button = {},
window = {},
label = {}
}
addEventHandler("onClientResourceStart", resourceRoot,
function ()
local screenW, screenH = guiGetScreenSize()
Waffen.window[2] = guiCreateWindow((screenW - 728) / 2, (screenH - 612) / 2, 728, 612, "Waffen ", false)
guiWindowSetSizable(Waffen.window[2], false)
guiSetAlpha(Waffen.window[2], 1.00)
Waffen.staticimage[2] = guiCreateStaticImage(658, 563, 31, 27, ":images/cross.png", false, Waffen.window[2])
Waffen.label[2] = guiCreateLabel(657, 563, 32, 27, "", false, Waffen.window[2])
Waffen.staticimage[3] = guiCreateStaticImage(49, 33, 93, 94, ":images/AK.png", false, Waffen.window[2])
Waffen.staticimage[4] = guiCreateStaticImage(175, 32, 85, 95, ":images/MP5.png", false, Waffen.window[2])
Waffen.label[3] = guiCreateLabel(1, 1, 84, 94, "", false, Waffen.staticimage[4])
Waffen.staticimage[5] = guiCreateStaticImage(319, 31, 83, 96, ":images/M4.png", false, Waffen.window[2])
Waffen.label[4] = guiCreateLabel(1, 1, 82, 95, "", false, Waffen.staticimage[5])
Waffen.staticimage[6] = guiCreateStaticImage(470, 32, 92, 95, ":images/Deagel.png", false, Waffen.window[2])
Waffen.label[5] = guiCreateLabel(-1, 2, 93, 93, "", false, Waffen.staticimage[6])
Waffen.label[6] = guiCreateLabel(49, 33, 93, 94, "", false, Waffen.window[2])
guiSetVisible(Waffen.window[2], false)
end
)
function open ()
guiSetVisible(Waffen.window[2], true)
showCursor(true)
end
addCommandHandler("gun", open)
function Abfrage()
local IsWindowVisible = guiGetVisible (Waffen.window[2])
if (IsWindowVisible == true) then
guiSetVisible(Waffen.window[2], false)
showCursor(false)
end
if (IsWindowVisible == false) then
guiSetVisible(Waffen.window[2], true)
guiSetInputEnabled(true)
showCursor(true)
end
end
addCommandHandler("gun", Abfrage)
Alles anzeigen
Ich hoffe ihr könnt mir helfen!
MfG
Leon