Szerző Téma: Gui, dimenziók, gombok  (Megtekintve 894 alkalommal)

Gui, dimenziók, gombok
« Dátum: 2016. Április 23. - 00:03:08 »
0 Show voters
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

Gui, dimenziók, gombok
« Válasz #1 Dátum: 2016. Április 23. - 19:35:07 »
0 Show voters
Mi ezzel a gond?
Rendesen működik

Nem elérhető id100

  • 903
    • Profil megtekintése
Gui, dimenziók, gombok
« Válasz #2 Dátum: 2016. Április 24. - 11:54:50 »
0 Show voters
A source kattintásnál a gomb amire kattintott a játékos. Kliens oldalon használj localPlayer -t .

Gui, dimenziók, gombok
« Válasz #3 Dátum: 2016. Április 24. - 22:42:01 »
0 Show voters
Köszönöm, így már működik! Viszont a következő probléma állt fel a showCursor paranccsal!
\"mta-screen_2016-04-24_22-38-33_www.kepfeltoltes.hu_.png\"
 
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
« Utoljára szerkesztve: 2016. Április 24. - 22:44:57 írta DarkxD »

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal