Sign in to follow this  
Szydlo

[HELP DGS]GUI showing all.

Recommended Posts

Hello, why gui showing(hide also) all, and add all row???? 

 

DGS = exports.dgs
function LGUI(player)
    if getLocalPlayer() == localPlayer then 
    Login = DGS:dgsDxCreateEdit(0.16, 0.4, 0.20, 0.05, "", true)
    Pass = DGS:dgsDxCreateEdit(0.16, 0.47, 0.20, 0.05, "", true)
        DGS:dgsDxEditSetMasked(Pass, true )
    LOGIN_BUTT = DGS:dgsDxCreateButton(0.20, 0.55, 0.1, 0.05, "Zaloguj", true)    
    showCursor(true)
    showChat(false)
end
end
addEventHandler("onClientResourceStart", root, LGUI)
function Login_click()
    if source == LOGIN_BUTT then
        local TEXT_LOGIN = DGS:dgsDxGUIGetText(Login)
        local TEXT_PASS = DGS:dgsDxGUIGetText(Pass)
        triggerServerEvent("LOGIN_CLICK", root, TEXT_LOGIN, TEXT_PASS)
    end
end
addEventHandler ("onClientDgsDxMouseClick", root, Login_click)
addEvent("LOGIN_TRUE", true)
function Login()
    DGS:dgsDxGUISetVisible(Login, false)
    DGS:dgsDxGUISetVisible(Pass, false)
    DGS:dgsDxGUISetVisible(LOGIN_BUTT, false)
    triggerEvent("LOGGED", root)
end
addEventHandler("LOGIN_TRUE", root, Login)

AND

getSelected = 0

addEvent("LOGGED", true)
function CHGUI()
	CH_GRID = DGS:dgsDxCreateGridList (346, 163, 433, 403, false )
	CH_BUTT = DGS:dgsDxCreateButton(0.20, 0.55, 0.1, 0.05, "Wybierz postać", true)
	CH_GRID_CID = DGS:dgsDxGridListAddColumn(CH_GRID, "CID", 0.5 )   
	CH_GRID_NAME = DGS:dgsDxGridListAddColumn(CH_GRID, "Imie i nazwisko", 0.2) 
	triggerServerEvent("GET_CH", root)
end
addEventHandler("LOGGED", root, CHGUI)
addEvent("CH_INFO", true)
function setCH(CHS,CH_CID, CH_NAME)
	for i,v in ipairs(CHS) do
		ROW_CH = DGS:dgsDxGridListAddRow(CH_GRID)
		SET_ROW_CID = DGS:dgsDxGridListSetItemText(CH_GRID, ROW_CH, CH_GRID_CID, CH_CID[i])
		SET_ROW_NAME = DGS:dgsDxGridListSetItemText(CH_GRID, ROW_CH, CH_GRID_NAME, CH_NAME[i])
	end
end
addEventHandler("CH_INFO", getLocalPlayer(), setCH)

addEventHandler ( "onClientDgsDxMouseClick", root, function()
	if source == CH_GRID then 
		Selected = DGS:dgsDxGridListGetSelectedItem(CH_GRID)
		getSelected = DGS:dgsDxGridListGetItemText(CH_GRID, Selected, CH_GRID_CID)
	end
	if source == CH_BUTT then
		if Selected == -1 or getSelected == 0 then
			outputChatBox("Nie wybrales postaci!")
		else
			triggerServerEvent("getCID", root, getSelected)
		end
	end
end)
addEvent("CH_SELECT", true)
function hideCHGUI()
	DGS:dgsDxGUISetVisible(CH_GRID, false)
	DGS:dgsDxGUISetVisible(CH_BUTT, false)
	showCursor(false)
	showChat(true)
end
addEventHandler("CH_SELECT", root, hideCHGUI)

 

Edited by Szydlo

Share this post


Link to post

Post the 'server-side'.

Edited by #Dv^

Share this post


Link to post

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.