Jump to content

Hi friend help please


xRGamingx

Recommended Posts

use the useful function 

by @Booo

  
TimeGuiSetTopC = { } 
  
function guiMoveTopToCenter(gui) 
if getElementData(gui,"HelhGui") == false then 
    setElementData(gui,"HelhGui",true) 
    local s1,s2=guiGetScreenSize() 
    local w1,w2=guiGetSize(gui,false) 
    local x,y = (s1-w1)/2,(s2-w2)/2 
    guiSetPosition(gui,x,-w2,false)  
  
TimeGuiSetTopC[gui] = setTimer(guiMoveTopToCenter,50,0,gui) 
end 
    local a,b=guiGetScreenSize() 
    local w1,w2=guiGetSize(gui,false) 
    local x,y = (a-w1)/2,(b-w2)/2 
    local x1,y1 = guiGetPosition ( gui, false) 
if (y1 >= y) then 
    killTimer(TimeGuiSetTopC[gui]) 
    setElementData(gui,"HelhGui",false) 
    else 
    guiSetPosition(gui,x1,(y1+10),false) 
end 
end 

Ex : 

wnd = guiCreateWindow ( ....... )

bindKey ( "f3" , "down" , function ( )
guiMoveTopToCenter ( wnd )
end );

and good luck

  • Like 1
Link to comment
10 hours ago, Default said:

use the useful function 

by @Booo


  TimeGuiSetTopC = { }   function guiMoveTopToCenter(gui) if getElementData(gui,"HelhGui") == false then     setElementData(gui,"HelhGui",true)     local s1,s2=guiGetScreenSize()     local w1,w2=guiGetSize(gui,false) 
    local x,y = (s1-w1)/2,(s2-w2)/2 
    guiSetPosition(gui,x,-w2,false)  
  
TimeGuiSetTopC[gui] = setTimer(guiMoveTopToCenter,50,0,gui) 
end 
    local a,b=guiGetScreenSize() 
    local w1,w2=guiGetSize(gui,false) 
    local x,y = (a-w1)/2,(b-w2)/2 
    local x1,y1 = guiGetPosition ( gui, false) 
if (y1 >= y) then 
    killTimer(TimeGuiSetTopC[gui]) 
    setElementData(gui,"HelhGui",false) 
    else 
    guiSetPosition(gui,x1,(y1+10),false) 
end 
end 

Ex : 


wnd = guiCreateWindow ( ....... )bindKey ( "f3" , "down" , function ( )guiMoveTopToCenter ( wnd )end );

and good luck

Broth , look my script , Login Panel..

Friend look this is the script, this is part of the login, fix it look

wdwLogin_Pannel = {}
tabPannel_Main = {}
tab_Login = {}
tab_Register = {}

--Settings
blackLoginScreen = false --True/false Black screen, while player login...
blackScreenTime = 6  --Time to complete disappearance of the black screen in seconds.

wdwLogin_Pannel = guiCreateWindow(0.34, 0.13, 0.32, 0.64, "¡ Hola "..getPlayerName(localPlayer).." Bienvenido a Gamer Pro !", true)
guiWindowSetSizable(wdwLogin_Pannel, false)
showCursor(true)
Actualiza = guiCreateMemo(0.02, 0.36, 0.96, 0.63, "", true, wdwLogin_Pannel)
guiMemoSetReadOnly(Actualiza, true)
edit_Login = guiCreateEdit(0.48, 0.08, 0.36, 0.07, "", true, wdwLogin_Pannel)
edit_password = guiCreateEdit(0.48, 0.16, 0.36, 0.07, "", true, wdwLogin_Pannel)
guiEditSetMasked(edit_password, true)
lbl_Login = guiCreateLabel(0.04, 0.08, 0.43, 0.07, "Usuario", true, wdwLogin_Pannel)
guiSetFont(lbl_Login, "sa-header")
guiLabelSetHorizontalAlign(lbl_Login, "right", false)
guiLabelSetVerticalAlign(lbl_Login, "center")
lbl_Password = guiCreateLabel(-0.04, 0.16, 0.50, 0.07, "Contraseña", true, wdwLogin_Pannel)
guiSetFont(lbl_Password, "sa-header")
guiLabelSetHorizontalAlign(lbl_Password, "right", false)
guiLabelSetVerticalAlign(lbl_Password, "center")
checkbox_save = guiCreateCheckBox(0.84, 0.08, 0.13, 0.05, "Recordar", true, true, wdwLogin_Pannel)
btn_Login = guiCreateButton(0.04, 0.28, 0.46, 0.06, "Loguear", true, wdwLogin_Pannel)
guiSetFont(btn_Login, "default-bold-small")
guiSetProperty(btn_Login, "NormalTextColour", "FFAAAAAA")
botonregistrar = guiCreateButton(0.50, 0.28, 0.46, 0.06, "Registrarse", true, wdwLogin_Pannel)
guiSetFont(botonregistrar, "default-bold-small")
guiSetProperty(botonregistrar, "NormalTextColour", "FFAAAAAA")
login_tab_error_msg = guiCreateLabel(0.04, 0.24, 0.92, 0.05, "", true, wdwLogin_Pannel)
guiSetFont(login_tab_error_msg, "default-bold-small")
guiLabelSetHorizontalAlign(login_tab_error_msg, "center", false)
guiLabelSetVerticalAlign(login_tab_error_msg, "center")

function open_log_reg_pannel(tabla)

	for i, g in pairs(tabla) do
	
guiSetText(Actualiza, tostring(g.info))
guiSetText(login_tab_error_msg, "") --Поле ошибки в Login табе
	
	local username, password = loadLoginFromXML()
	
	if not( username == "" or password == "") then
		guiCheckBoxSetSelected ( checkbox_save, true )
		guiSetText ( edit_Login, tostring(username))
		guiSetText ( edit_password, tostring(password))
	else
		guiCheckBoxSetSelected ( checkbox_save, false )
		guiSetText ( edit_Login, tostring(username))
		guiSetText ( edit_password, tostring(password))
	end

	--Эвенты
end
end
addEvent("ponerElLogin", true)
addEventHandler("ponerElLogin", root, open_log_reg_pannel)

 

Edited by xRGamingx
Link to comment

try this 

wdwLogin_Pannel = {}
tabPannel_Main = {}
tab_Login = {}
tab_Register = {}

  
TimeGuiSetTopC = { } 
  
function guiMoveTopToCenter(gui) 
if getElementData(gui,"HelhGui") == false then 
    setElementData(gui,"HelhGui",true) 
    local s1,s2=guiGetScreenSize() 
    local w1,w2=guiGetSize(gui,false) 
    local x,y = (s1-w1)/2,(s2-w2)/2 
    guiSetPosition(gui,x,-w2,false)  
  
TimeGuiSetTopC[gui] = setTimer(guiMoveTopToCenter,50,0,gui) 
end 
    local a,b=guiGetScreenSize() 
    local w1,w2=guiGetSize(gui,false) 
    local x,y = (a-w1)/2,(b-w2)/2 
    local x1,y1 = guiGetPosition ( gui, false) 
if (y1 >= y) then 
    killTimer(TimeGuiSetTopC[gui]) 
    setElementData(gui,"HelhGui",false) 
    else 
    guiSetPosition(gui,x1,(y1+10),false) 
end 
end 

--Settings
blackLoginScreen = false --True/false Black screen, while player login...
blackScreenTime = 6  --Time to complete disappearance of the black screen in seconds.

wdwLogin_Pannel = guiCreateWindow(0.34, 0.13, 0.32, 0.64, "¡ Hola "..getPlayerName(localPlayer).." Bienvenido a Gamer Pro !", true)
guiWindowSetSizable(wdwLogin_Pannel, false)
showCursor(true)
guiMoveTopToCenter ( wdwLogin_Pannel )
Actualiza = guiCreateMemo(0.02, 0.36, 0.96, 0.63, "", true, wdwLogin_Pannel)
guiMemoSetReadOnly(Actualiza, true)
edit_Login = guiCreateEdit(0.48, 0.08, 0.36, 0.07, "", true, wdwLogin_Pannel)
edit_password = guiCreateEdit(0.48, 0.16, 0.36, 0.07, "", true, wdwLogin_Pannel)
guiEditSetMasked(edit_password, true)
lbl_Login = guiCreateLabel(0.04, 0.08, 0.43, 0.07, "Usuario", true, wdwLogin_Pannel)
guiSetFont(lbl_Login, "sa-header")
guiLabelSetHorizontalAlign(lbl_Login, "right", false)
guiLabelSetVerticalAlign(lbl_Login, "center")
lbl_Password = guiCreateLabel(-0.04, 0.16, 0.50, 0.07, "Contraseña", true, wdwLogin_Pannel)
guiSetFont(lbl_Password, "sa-header")
guiLabelSetHorizontalAlign(lbl_Password, "right", false)
guiLabelSetVerticalAlign(lbl_Password, "center")
checkbox_save = guiCreateCheckBox(0.84, 0.08, 0.13, 0.05, "Recordar", true, true, wdwLogin_Pannel)
btn_Login = guiCreateButton(0.04, 0.28, 0.46, 0.06, "Loguear", true, wdwLogin_Pannel)
guiSetFont(btn_Login, "default-bold-small")
guiSetProperty(btn_Login, "NormalTextColour", "FFAAAAAA")
botonregistrar = guiCreateButton(0.50, 0.28, 0.46, 0.06, "Registrarse", true, wdwLogin_Pannel)
guiSetFont(botonregistrar, "default-bold-small")
guiSetProperty(botonregistrar, "NormalTextColour", "FFAAAAAA")
login_tab_error_msg = guiCreateLabel(0.04, 0.24, 0.92, 0.05, "", true, wdwLogin_Pannel)
guiSetFont(login_tab_error_msg, "default-bold-small")
guiLabelSetHorizontalAlign(login_tab_error_msg, "center", false)
guiLabelSetVerticalAlign(login_tab_error_msg, "center")

function open_log_reg_pannel(tabla)

	for i, g in pairs(tabla) do
	
guiSetText(Actualiza, tostring(g.info))
guiSetText(login_tab_error_msg, "") --Поле ошибки в Login табе
	
	local username, password = loadLoginFromXML()
	
	if not( username == "" or password == "") then
		guiCheckBoxSetSelected ( checkbox_save, true )
		guiSetText ( edit_Login, tostring(username))
		guiSetText ( edit_password, tostring(password))
	else
		guiCheckBoxSetSelected ( checkbox_save, false )
		guiSetText ( edit_Login, tostring(username))
		guiSetText ( edit_password, tostring(password))
	end

	--Эвенты
end
end
addEvent("ponerElLogin", true)
addEventHandler("ponerElLogin", root, open_log_reg_pannel)

 

Link to comment
  • 1 month later...
On 11/11/2016 at 10:32 PM, Default said:

try this 


wdwLogin_Pannel = {}tabPannel_Main = {}tab_Login = {}tab_Register = {}  TimeGuiSetTopC = { }   function guiMoveTopToCenter(gui) if getElementData(gui,"HelhGui") == false then     setElementData(gui,"HelhGui",true)     local s1,s2=guiGetScreenSize()     local w1,w2=guiGetSize(gui,false)     local x,y = (s1-w1)/2,(s2-w2)/2     guiSetPosition(gui,x,-w2,false)    TimeGuiSetTopC[gui] = setTimer(guiMoveTopToCenter,50,0,gui) end     local a,b=guiGetScreenSize()     local w1,w2=guiGetSize(gui,false)     local x,y = (a-w1)/2,(b-w2)/2     local x1,y1 = guiGetPosition ( gui, false) if (y1 >= y) then     killTimer(TimeGuiSetTopC[gui])     setElementData(gui,"HelhGui",false)     else     guiSetPosition(gui,x1,(y1+10),false) end end --SettingsblackLoginScreen = false --True/false Black screen, while player login...blackScreenTime = 6  --Time to complete disappearance of the black screen in seconds.wdwLogin_Pannel = guiCreateWindow(0.34, 0.13, 0.32, 0.64, "¡ Hola "..getPlayerName(localPlayer).." Bienvenido a Gamer Pro !", true)guiWindowSetSizable(wdwLogin_Pannel, false)showCursor(true)guiMoveTopToCenter ( wdwLogin_Pannel )Actualiza = guiCreateMemo(0.02, 0.36, 0.96, 0.63, "", true, wdwLogin_Pannel)guiMemoSetReadOnly(Actualiza, true)edit_Login = guiCreateEdit(0.48, 0.08, 0.36, 0.07, "", true, wdwLogin_Pannel)edit_password = guiCreateEdit(0.48, 0.16, 0.36, 0.07, "", true, wdwLogin_Pannel)guiEditSetMasked(edit_password, true)lbl_Login = guiCreateLabel(0.04, 0.08, 0.43, 0.07, "Usuario", true, wdwLogin_Pannel)guiSetFont(lbl_Login, "sa-header")guiLabelSetHorizontalAlign(lbl_Login, "right", false)guiLabelSetVerticalAlign(lbl_Login, "center")lbl_Password = guiCreateLabel(-0.04, 0.16, 0.50, 0.07, "Contraseña", true, wdwLogin_Pannel)guiSetFont(lbl_Password, "sa-header")guiLabelSetHorizontalAlign(lbl_Password, "right", false)guiLabelSetVerticalAlign(lbl_Password, "center")checkbox_save = guiCreateCheckBox(0.84, 0.08, 0.13, 0.05, "Recordar", true, true, wdwLogin_Pannel)btn_Login = guiCreateButton(0.04, 0.28, 0.46, 0.06, "Loguear", true, wdwLogin_Pannel)guiSetFont(btn_Login, "default-bold-small")guiSetProperty(btn_Login, "NormalTextColour", "FFAAAAAA")botonregistrar = guiCreateButton(0.50, 0.28, 0.46, 0.06, "Registrarse", true, wdwLogin_Pannel)guiSetFont(botonregistrar, "default-bold-small")guiSetProperty(botonregistrar, "NormalTextColour", "FFAAAAAA")login_tab_error_msg = guiCreateLabel(0.04, 0.24, 0.92, 0.05, "", true, wdwLogin_Pannel)guiSetFont(login_tab_error_msg, "default-bold-small")guiLabelSetHorizontalAlign(login_tab_error_msg, "center", false)guiLabelSetVerticalAlign(login_tab_error_msg, "center")function open_log_reg_pannel(tabla)	for i, g in pairs(tabla) do	guiSetText(Actualiza, tostring(g.info))guiSetText(login_tab_error_msg, "") --Поле ошибки в Login табе		local username, password = loadLoginFromXML()		if not( username == "" or password == "") then		guiCheckBoxSetSelected ( checkbox_save, true )		guiSetText ( edit_Login, tostring(username))		guiSetText ( edit_password, tostring(password))	else		guiCheckBoxSetSelected ( checkbox_save, false )		guiSetText ( edit_Login, tostring(username))		guiSetText ( edit_password, tostring(password))	end	--ЭвентыendendaddEvent("ponerElLogin", true)addEventHandler("ponerElLogin", root, open_log_reg_pannel)

 

ohhhhhhhhhhh broth Thankkksss Goodd

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...