[YARDIM] Ayrı Panel Açılma

0 Üye ve 1 Ziyaretçi konuyu incelemekte.

Çevrimdışı Quadro

  • Engin YILMAZ
  • Admin
  • *
    • İleti: 471
: 21 Haziran 2017, 09:20:44
Üzerinde çalıştığım bir scriptim, var bu scriptte bir butona basılınca ayrı bir pencere açılmasını istiyorum fakat bir türlü beceremedim yapıyorum bozuluyor yardım eder misiniz acaba? Sadece kodları atsanız yeter.
« Son Düzenleme: 21 Haziran 2017, 23:45:43 Gönderen: Narkoz »
 


MTASATURK

[YARDIM] Ayrı Panel Açılma
« : 21 Haziran 2017, 09:20:44 »

Çevrimdışı ByCash

  • Admin
  • *
    • İleti: 986
Yanıtla #1 : 21 Haziran 2017, 10:13:12
1.Panel
Kod: lua
panel1 = guiCreateWindow(a, b, c, d, "Panel 1", false)
guiSetVisible(panel1, false)

buton1 = guiCreateButton(a, b, c, d, "Panel 1 Kapat", false, panel1)

addEventHandler("onClientGUIClick", root,
function()
if source == buton1 then
guiSetVisible(panel1, false)
showCursor(false)
end
end)

buton2 = guiCreateButton(a, b, c, d, "Panel 2 Aç", false, panel1)

addEventHandler("onClientGUIClick", root,
function()
if source == buton2 then
guiSetVisible(panel1, false)
guiSetVisible(panel2, true)
end
end)

2. Panel
Kod: lua
panel2 = guiCreateWindow(a, b, c, d, "Panel 2", false)
guiSetVisible(panel2, false)

buton3 = guiCreateButton(a, b, c, d, "Kapat Panel 2", false, panel2)

addEventHandler("onCilentGUIClick", root,
function()
if source == buton3 then
guiSetVisible(panel2, false)
showCursor(false)
end
end)

Açma kapatma fonksiyonu
Kod: lua
bindKey("F2", "down",
function()
if (guiGetVisible(panel1) == true) then
guiSetVisible(panel1, false)
guiSetVisible(panel2, false)
showCursor(false)
elseif (guiGetVisible(panel1) == false) then
guiSetVisible(panel1, true)
guiSetVisible(panel2, false)
showCursor(true)
end
end)

Kordinatlarını kendin ayarlarsın, telden yazdım bir hata olursa söylersin.
« Son Düzenleme: 21 Haziran 2017, 23:12:08 Gönderen: ByCash »
 


Çevrimdışı Narkoz

  • Kurucu
  • *
    • İleti: 507
  • SH Gaming
Yanıtla #2 : 21 Haziran 2017, 23:49:11
Buyur bu kodu ekle scriptine butona basınca panel açılır diğer panelde kapanır bunu kodlardan ayarlayabilirsin.

Kod: lua
function panel_ac()
if source == buton1 then
guiSetVisible(panel1, false)
guiSetVisible(panel2, true)
end
end
addEventHandler("onClientGUIClick", root, panel_ac)
« Son Düzenleme: 27 Haziran 2017, 18:27:10 Gönderen: Narkoz »