Itt a source az arra a játékosra érvényes, aki rákattintott a gombra, vagy valamit megint nagyon benéztem? :D
A lényeg az, hogy akarok csinálni egy panelt, ami átrakja a játékost egy másik dimenzióba.
GUIEditor = {
button = {},
window = {}
}
addEventHandler(\"onClientResourceStart\", resourceRoot,
function()
showCursor(true)
local screenW, screenH = guiGetScreenSize()
GUIEditor.window[1] = guiCreateWindow((screenW - 477) / 2, (screenH - 266) / 2, 477, 266, \"Válassz egy dimenziót!\", false)
GUIEditor.button1 = guiCreateButton(10, (266 - 85) / 2, 137, 85, \"Dimenzió 0\\nNormál\", false, GUIEditor.window[1])
addEventHandler(\"onClientGUIClick\",GUIEditor.button1, dimenzio0)
GUIEditor.button2 = guiCreateButton(477 - 135 - 10, (266 - 82) / 2, 135, 82, \"Dimenzió 1\\nZombik\", false, GUIEditor.window[1])
addEventHandler(\"onClientGUIClick\",GUIEditor.button2, dimenzio1)
end
)
function dimenzio0()
setElementDimension ( source, 0 )
end
function dimenzio1()
setElementDimension ( source, 1 )
end
Köszönöm, így már működik! Viszont a következő probléma állt fel a showCursor paranccsal!

GUIEditor = {
button = {},
window = {}
}
addCommandHandler(\"zombi\",
function()
showCursos(true)
local screenW, screenH = guiGetScreenSize()
GUIEditor.window[1] = guiCreateWindow((screenW - 477) / 2, (screenH - 266) / 2, 477, 266, \"Válassz egy dimenziót!\", false)
guiWindowSetSizable(GUIEditor.window[1], false)
guiSetAlpha(GUIEditor.window[1], 0.81)
GUIEditor.button[1] = guiCreateButton(9, 28, 459, 85, \"Dimenzió 0\\nNormál\", false, GUIEditor.window[1])
addEventHandler(\"onClientGUIClick\",GUIEditor.button[1], dimenzio0)
GUIEditor.button[2] = guiCreateButton(9, 123, 459, 82, \"Dimenzió 1\\nZombik\", false, GUIEditor.window[1])
addEventHandler(\"onClientGUIClick\",GUIEditor.button[2], dimenzio1)
GUIEditor.button[3] = guiCreateButton(179, 215, 120, 37, \"Bezár\", false, GUIEditor.window[1])
addEventHandler(\"onClientGUIClick\",GUIEditor.button[3], bezar)
end
)
function dimenzio0()
setElementDimension (localPlayer,0)
end
function dimenzio1()
setElementDimension (localPlayer,1)
end
function bezar()
showCursos(false)
guiSetVisible(GUIEditor.window[1],false)
end
Dupla hozzászólás automatikusan összefûzve. ( 2016. április 24. - 22:44:57 )
Bocs, már rájöttem! :wall: :wall: :wall: :wall: ;D