LPM//Bruno Posted June 22, 2014 Share Posted June 22, 2014 Hola amigos tengo un problema con mi GUI que he echo desde 0 por mi y me ayudo un poco lLinux. Tengo un problema, cuando abro la GUI todos pueden verla y clickearla, cerrarla etc como si se abriese desde la pc del otro jugador hacia todas las pc de los player conectados. ¿que he echo mal? He aqui el codigo: (client) g_Me = getLocalPlayer() GUIEditor = { label = {} } panelvip = guiCreateWindow(271, 202, 257, 271, "Panel VIP | MTA-LPM", false) guiWindowSetSizable(panelvip, false) guiSetVisible (panelvip, false) botonhandlings = guiCreateButton(14, 33, 106, 39, "Handlings", false, panelvip) botonskinvip = guiCreateButton(138, 33, 106, 39, "Skin VIP", false, panelvip) botonarmasvip = guiCreateButton(138, 86, 106, 39, "Armas VIP", false, panelvip) botonjetpack = guiCreateButton(14, 86, 106, 39, "Jetpack", false, panelvip) botonchalecovip = guiCreateButton(138, 142, 106, 39, "Chaleco VIP", false, panelvip) botonstunt = guiCreateButton(14, 142, 106, 39, "Stunt", false, panelvip) botoncerrar = guiCreateButton(14, 196, 230, 39, "Cerrar", false, panelvip) GUIEditor.label[1] = guiCreateLabel(74, 245, 115, 20, "www.mtalpm.com.ar", false, panelvip) addCommandHandler ("vip" , "Ani open") --GUI HEADLING -- Aqui se crea la gui cuando inician el resource handlings = guiCreateWindow(141, 204, 125, 291, "Handlings VIP", false) guiWindowSetSizable(handlings, false) guiSetVisible(handlings, false) -- Este la oculta. botonpicada = guiCreateButton(9, 35, 106, 29, "Picada", false, handlings) botonpaseo = guiCreateButton(9, 74, 106, 29, "Paseo", false, handlings) botonhellaflush = guiCreateButton(9, 113, 106, 29, "Hellaflush", false, handlings) botonalpiso = guiCreateButton(9, 152, 106, 29, "Al piso", false, handlings) function botonhandlingsfunc() if (guiGetVisible(handlings) == false) then --Si la gui handlings es no es visible (esto no es necesario, pero asi queda bien.) guiSetVisible (handlings, true ) -- la pone visible else guiSetVisible (handlings, false ) --la pone invisible end addEventHandler ("onClientGUIClick" , botonpicada, botonpicadafunc, false) addEventHandler ("onClientGUIClick" , botonpaseo, botonpaseofunc, false) addEventHandler ("onClientGUIClick" , botonhellaflush, botonhellaflushfunc, false) addEventHandler ("onClientGUIClick" , botonalpiso, botonalpisofunc, false) end boton = { hand = {}, anim = {} } GUIEditor = { label = {}, window = {} } GUIEditor.window[1] = guiCreateWindow(533, 203, 125, 291, "Stunt VIP", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1],false) botonanim1 = guiCreateButton(10, 58, 105, 30, "Anim. 1", false, GUIEditor.window[1]) GUIEditor.label[1] = guiCreateLabel(8, 26, 107, 15, "Animaciones", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[1], "clear-normal") guiLabelSetHorizontalAlign(GUIEditor.label[1], "center", false) GUIEditor.label[2] = guiCreateLabel(8, 144, 107, 15, "Handlings", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[2], "clear-normal") guiLabelSetHorizontalAlign(GUIEditor.label[2], "center", false) botonanim2 = guiCreateButton(10, 98, 105, 30, "Anim. 2", false, GUIEditor.window[1]) botonhand1 = guiCreateButton(10, 173, 105, 30, "Handling 1", false, GUIEditor.window[1]) botonhand2 = guiCreateButton(10, 213, 105, 30, "Handling 2", false, GUIEditor.window[1]) function botonstuntfunc() if (guiGetVisible(GUIEditor.window[1]) == false) then --Si la gui handlings es no es visible (esto no es necesario, pero asi queda bien.) guiSetVisible (GUIEditor.window[1], true ) -- la pone visible else guiSetVisible (GUIEditor.window[1], false ) --la pone invisible end addEventHandler ("onClientGUIClick" , botonanim1, botonanim1func, false) addEventHandler ("onClientGUIClick" , botonanim2, botonanim2func, false) addEventHandler ("onClientGUIClick" , botonhand1, botonhand1func, false) addEventHandler ("onClientGUIClick" , botonhand2, botonhand2func, false) end function botonhand1func() triggerServerEvent ("HandlingStunt1",localPlayer) end function botonhand2func() triggerServerEvent ("HandlingStunt2",localPlayer) end anim1 = false function botonanim1func() if (anim1 == false) then anim1 = true anim2 = false triggerServerEvent ("StuntAnim1activado",localPlayer) else anim1 = false triggerServerEvent ("StuntAnim1desactivado",localPlayer) end end anim2 = false function botonanim2func() if (anim2 == false) then anim2 = true triggerServerEvent ("StuntAnim2activado",localPlayer) else anim2 = false anim1 = false triggerServerEvent ("StuntAnim2desactivado",localPlayer) end end -- Boton skin vip function botonskinvipfunc() triggerServerEvent ("SkinVIP",localPlayer) end -- Boton armas vip function botonarmasvipfunc() triggerServerEvent ("ArmasVIP",localPlayer) end -- Boton jetpack function botonjetpackfunc() triggerServerEvent ("Jetpack",localPlayer) end -- Boton chaleco vip function botonchalecovipfunc() triggerServerEvent ("ChalecoVIP",localPlayer) end -- Boton cerrar function botoncerrarfunc() showCursor (false) guiSetVisible (panelvip, false ) guiSetVisible (handlings, false ) guiSetVisible (GUIEditor.window[1], false ) end function botoncerrarfunc_stunt() guiSetVisible (GUIEditor.window[1], false ) end function botoncerrarfunc_handlings() guiSetVisible (handlings, false ) end ------------------ -- BOTONES HANDLING function botonpicadafunc() triggerServerEvent ("HandlingPicada",localPlayer) end function botonpaseofunc() triggerServerEvent ("HandlingPaseo",localPlayer) end function botonhellaflushfunc() triggerServerEvent ("HandlingHellaflush",localPlayer) end function botonalpisofunc() triggerServerEvent ("HandlingAlpiso",localPlayer) end -- OPEN GUI function opengui() if not guiGetVisible(panelvip) then ani_otworz() else ani_zamknij() end end bindKey( "F4", "down", "vip") addCommandHandler("Ani open", funcioncheck) addEvent( "Abrir", true ) addEventHandler( "Abrir", getRootElement(), opengui ) function funcioncheck() triggerServerEvent ("checkserver",localPlayer) end function ani_otworz() if not guiGetVisible(panelvip) and not guiGetVisible(handlings) and not guiGetVisible(GUIEditor.window[1]) then guiSetVisible(panelvip, true) showCursor(true) end addEventHandler ("onClientGUIClick" , botonhandlings, botonhandlingsfunc, false) addEventHandler ("onClientGUIClick" , botonskinvip, botonskinvipfunc, false) addEventHandler ("onClientGUIClick" , botonarmasvip, botonarmasvipfunc, false) addEventHandler ("onClientGUIClick" , botonjetpack, botonjetpackfunc, false) addEventHandler ("onClientGUIClick" , botonchalecovip, botonchalecovipfunc, false) Link to comment
lLinux Posted June 22, 2014 Share Posted June 22, 2014 Hola amigos tengo un problema con mi GUI que he echo desde 0 por mi y me ayudo un poco lLinux.Tengo un problema, cuando abro la GUI todos pueden verla y clickearla, cerrarla etc como si se abriese desde la pc del otro jugador hacia todas las pc de los player conectados. ¿que he echo mal? He aqui el codigo: (client) g_Me = getLocalPlayer() GUIEditor = { label = {} } panelvip = guiCreateWindow(271, 202, 257, 271, "Panel VIP | MTA-LPM", false) guiWindowSetSizable(panelvip, false) guiSetVisible (panelvip, false) botonhandlings = guiCreateButton(14, 33, 106, 39, "Handlings", false, panelvip) botonskinvip = guiCreateButton(138, 33, 106, 39, "Skin VIP", false, panelvip) botonarmasvip = guiCreateButton(138, 86, 106, 39, "Armas VIP", false, panelvip) botonjetpack = guiCreateButton(14, 86, 106, 39, "Jetpack", false, panelvip) botonchalecovip = guiCreateButton(138, 142, 106, 39, "Chaleco VIP", false, panelvip) botonstunt = guiCreateButton(14, 142, 106, 39, "Stunt", false, panelvip) botoncerrar = guiCreateButton(14, 196, 230, 39, "Cerrar", false, panelvip) GUIEditor.label[1] = guiCreateLabel(74, 245, 115, 20, "www.mtalpm.com.ar", false, panelvip) addCommandHandler ("vip" , "Ani open") --GUI HEADLING -- Aqui se crea la gui cuando inician el resource handlings = guiCreateWindow(141, 204, 125, 291, "Handlings VIP", false) guiWindowSetSizable(handlings, false) guiSetVisible(handlings, false) -- Este la oculta. botonpicada = guiCreateButton(9, 35, 106, 29, "Picada", false, handlings) botonpaseo = guiCreateButton(9, 74, 106, 29, "Paseo", false, handlings) botonhellaflush = guiCreateButton(9, 113, 106, 29, "Hellaflush", false, handlings) botonalpiso = guiCreateButton(9, 152, 106, 29, "Al piso", false, handlings) function botonhandlingsfunc() if (guiGetVisible(handlings) == false) then --Si la gui handlings es no es visible (esto no es necesario, pero asi queda bien.) guiSetVisible (handlings, true ) -- la pone visible else guiSetVisible (handlings, false ) --la pone invisible end addEventHandler ("onClientGUIClick" , botonpicada, botonpicadafunc, false) addEventHandler ("onClientGUIClick" , botonpaseo, botonpaseofunc, false) addEventHandler ("onClientGUIClick" , botonhellaflush, botonhellaflushfunc, false) addEventHandler ("onClientGUIClick" , botonalpiso, botonalpisofunc, false) end boton = { hand = {}, anim = {} } GUIEditor = { label = {}, window = {} } GUIEditor.window[1] = guiCreateWindow(533, 203, 125, 291, "Stunt VIP", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1],false) botonanim1 = guiCreateButton(10, 58, 105, 30, "Anim. 1", false, GUIEditor.window[1]) GUIEditor.label[1] = guiCreateLabel(8, 26, 107, 15, "Animaciones", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[1], "clear-normal") guiLabelSetHorizontalAlign(GUIEditor.label[1], "center", false) GUIEditor.label[2] = guiCreateLabel(8, 144, 107, 15, "Handlings", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[2], "clear-normal") guiLabelSetHorizontalAlign(GUIEditor.label[2], "center", false) botonanim2 = guiCreateButton(10, 98, 105, 30, "Anim. 2", false, GUIEditor.window[1]) botonhand1 = guiCreateButton(10, 173, 105, 30, "Handling 1", false, GUIEditor.window[1]) botonhand2 = guiCreateButton(10, 213, 105, 30, "Handling 2", false, GUIEditor.window[1]) function botonstuntfunc() if (guiGetVisible(GUIEditor.window[1]) == false) then --Si la gui handlings es no es visible (esto no es necesario, pero asi queda bien.) guiSetVisible (GUIEditor.window[1], true ) -- la pone visible else guiSetVisible (GUIEditor.window[1], false ) --la pone invisible end addEventHandler ("onClientGUIClick" , botonanim1, botonanim1func, false) addEventHandler ("onClientGUIClick" , botonanim2, botonanim2func, false) addEventHandler ("onClientGUIClick" , botonhand1, botonhand1func, false) addEventHandler ("onClientGUIClick" , botonhand2, botonhand2func, false) end function botonhand1func() triggerServerEvent ("HandlingStunt1",localPlayer) end function botonhand2func() triggerServerEvent ("HandlingStunt2",localPlayer) end anim1 = false function botonanim1func() if (anim1 == false) then anim1 = true anim2 = false triggerServerEvent ("StuntAnim1activado",localPlayer) else anim1 = false triggerServerEvent ("StuntAnim1desactivado",localPlayer) end end anim2 = false function botonanim2func() if (anim2 == false) then anim2 = true triggerServerEvent ("StuntAnim2activado",localPlayer) else anim2 = false anim1 = false triggerServerEvent ("StuntAnim2desactivado",localPlayer) end end -- Boton skin vip function botonskinvipfunc() triggerServerEvent ("SkinVIP",localPlayer) end -- Boton armas vip function botonarmasvipfunc() triggerServerEvent ("ArmasVIP",localPlayer) end -- Boton jetpack function botonjetpackfunc() triggerServerEvent ("Jetpack",localPlayer) end -- Boton chaleco vip function botonchalecovipfunc() triggerServerEvent ("ChalecoVIP",localPlayer) end -- Boton cerrar function botoncerrarfunc() showCursor (false) guiSetVisible (panelvip, false ) guiSetVisible (handlings, false ) guiSetVisible (GUIEditor.window[1], false ) end function botoncerrarfunc_stunt() guiSetVisible (GUIEditor.window[1], false ) end function botoncerrarfunc_handlings() guiSetVisible (handlings, false ) end ------------------ -- BOTONES HANDLING function botonpicadafunc() triggerServerEvent ("HandlingPicada",localPlayer) end function botonpaseofunc() triggerServerEvent ("HandlingPaseo",localPlayer) end function botonhellaflushfunc() triggerServerEvent ("HandlingHellaflush",localPlayer) end function botonalpisofunc() triggerServerEvent ("HandlingAlpiso",localPlayer) end -- OPEN GUI function opengui() if not guiGetVisible(panelvip) then ani_otworz() else ani_zamknij() end end bindKey( "F4", "down", "vip") addCommandHandler("Ani open", funcioncheck) addEvent( "Abrir", true ) addEventHandler( "Abrir", getRootElement(), opengui ) function funcioncheck() triggerServerEvent ("checkserver",localPlayer) end function ani_otworz() if not guiGetVisible(panelvip) and not guiGetVisible(handlings) and not guiGetVisible(GUIEditor.window[1]) then guiSetVisible(panelvip, true) showCursor(true) end addEventHandler ("onClientGUIClick" , botonhandlings, botonhandlingsfunc, false) addEventHandler ("onClientGUIClick" , botonskinvip, botonskinvipfunc, false) addEventHandler ("onClientGUIClick" , botonarmasvip, botonarmasvipfunc, false) addEventHandler ("onClientGUIClick" , botonjetpack, botonjetpackfunc, false) Link to comment
Recommended Posts