Jump to content

Recommended Posts

  • Scripting Moderators
  On 31/05/2017 at 12:53, Senpai said:

ok cool, would like to see more on this resource it looks cool!

would like to see radio button also...

Expand  

Radio Button, Check Box, Tab Panel Can Be Made As Plugins. But I think that you prefer them in core.

And it is still WIP, though I have spent 2 years in programming it

Edited by thisdp
Link to comment
  • Scripting Moderators
  On 31/05/2017 at 12:56, Senpai said:

either way is fine :D

Expand  

Don't worry. You can see the update log in : angel.mtaip.cn:233/dgsUpdate

And it will check update itself.

Edited by thisdp
Link to comment
  • Scripting Moderators
  On 31/05/2017 at 12:53, Senpai said:

ok cool, would like to see more on this resource it looks cool!

would like to see radio button also...

Expand  

By the way, label can execute functions.

local fnc = [[

--self is defined as the dxgui which is executing this function.

local arg = {...} -- arguments

return getPlayerName(localPlayer)

 ]]

dgsDxGUISetProperty(label,"functions",fnc,"arguments",...)

 

Link to comment
  On 31/05/2017 at 13:34, thisdp said:

By the way, label can execute functions.


local fnc = [[

--self is defined as the dxgui which is executing this function.

local arg = {...} -- arguments

return getPlayerName(localPlayer)

 ]]

dgsDxGUISetProperty(label,"functions",fnc,"arguments",...)

 

Expand  

thats cool...

Link to comment
  On 01/06/2017 at 12:50, thisdp said:

 

Thx. It will be cooler if you continue to use it

Expand  

I will start using it after there will be support for a function like guiCreateTabPanel and checkbox or I make it myself but I am not familiar with your code. Any tips how should i do it? (I will share the final code if it works fine)

Link to comment
  • Scripting Moderators
  On 02/06/2017 at 09:51, Axel said:

I will start using it after there will be support for a function like guiCreateTabPanel and checkbox or I make it myself but I am not familiar with your code. Any tips how should i do it? (I will share the final code if it works fine)

Expand  

I am writing wiki for dgs . see the head page. And the usage actually is very like the original gui's. So it is easy to get familiar with it. xD

  On 01/06/2017 at 19:17, Senpai said:

Yes I did got it and I updated it

Expand  

good. it works

Link to comment

Hello How are you? I have a question. I want a function. To create a login panel I want to use what I do not like Use Dximage I want to

  On 02/06/2017 at 11:39, thisdp said:

I am writing wiki for dgs . see the head page. And the usage actually is very like the original gui's. So it is easy to get familiar with it. xD

good. it works

Expand  

help you use the function and thank you


Hello How are you? I have a question. I want a function. To create a dx login panel I want to use what I do not like Example
Use Dximage
I want to help you use the function and thank you

Link to comment
  • Scripting Moderators
  On 02/06/2017 at 12:11, Ismaeel_finer said:

Hello How are you? I have a question. I want a function. To create a login panel I want to use what I do not like Use Dximage I want to

help you use the function and thank you


Hello How are you? I have a question. I want a function. To create a dx login panel I want to use what I do not like Example
Use Dximage
I want to help you use the function and thank you

Expand  

Install my script and start it.

Create a client.lua in your login panel resource. Here is an example.

DGS = exports.dgs
loginpanel = {}
loginpanel.userlabel = DGS:dgsDxCreateLabel(0.3,0.43,0.2,0.1,"Username:",true)
loginpanel.passlabel = DGS:dgsDxCreateLabel(0.3,0.47,0.2,0.1,"Password:",true)
loginpanel.usern = DGS:dgsDxCreateEdit(0.3,0.43,0.5,0.1,"",true)
loginpanel.passw = DGS:dgsDxCreateEdit(0.3,0.57,0.5,0.1,"",true)
loginpanel.login = DGS:dgsDxCreateButton(0.4,0.7,0.3,0.1,"Login",true)


addEventHandler("onClientDgsMouseClick",resourceRoot,function(button,state)
	if source == loginpanel.login then
		local usern = DGS:dgsDxGUIGetText(loginpanel.usern)
		local passw = DGS:dgsDxGUIGetText(loginpanel.passw)
		if not usern or #usern == 0 then
			outputChatBox("Please enter your username.",255,0,0)
			return
  		end
		if not passw or #passw == 0 then
			outputChatBox("Please enter your password.",255,0,0)
			return
  		end
		triggerServerEvent("onClientSendLoginData",localPlayer,usern,passw)
	end
end)

 

Edited by thisdp
Link to comment
  On 02/06/2017 at 12:57, thisdp said:

Install my script and start it.

Create a client.lua in your login panel resource. Here is an example.


DGS = exports.dgs
loginpanel = {}
loginpanel.userlabel = DGS:dgsDxCreateLabel(0.3,0.43,0.2,0.1,"Username:",true)
loginpanel.passlabel = DGS:dgsDxCreateLabel(0.3,0.47,0.2,0.1,"Password:",true)
loginpanel.usern = DGS:dgsDxCreateEdit(0.3,0.43,0.5,0.1,"",true)
loginpanel.passw = DGS:dgsDxCreateEdit(0.3,0.57,0.5,0.1,"",true)
loginpanel.login = DGS:dgsDxCreateButton(0.4,0.7,0.3,0.1,"Login",true)


addEventHandler("onClientDgsMouseClick",resourceRoot,function(button,state)
	if source == loginpanel.login then
		local usern = DGS:dgsDxGUIGetText(loginpanel.usern)
		local passw = DGS:dgsDxGUIGetText(loginpanel.passw)
		if not usern or #usern == 0 then
			outputChatBox("Please enter your username.",255,0,0)
			return
  		end
		if not passw or #passw == 0 then
			outputChatBox("Please enter your password.",255,0,0)
			return
  		end
		triggerServerEvent("onClientSendLoginData",localPlayer,usern,passw)
	end
end)

 

Expand  

Thx pro

Link to comment
function login_panel()
local screenW, screenH = guiGetScreenSize()
        main_win = DGS:dgsDxCreateWindow((screenW - 616) / 2, (screenH - 402) / 2, 616, 402, "", false)
        DGS:dgsDxWindowSetSizable(main_win, false)

        userlb = DGS:dgsDxCreateLabel(6, 18, 145, 32, "USERNAME:", false, main_win)
        guiLabelSetHorizontalAlign(userlb, "center", false)
        guiLabelSetVerticalAlign(userlb, "center")
        passlb = DGS:dgsDxCreateLabel(6, 50, 145, 32, "PASSWORD", false, main_win)
        guiLabelSetHorizontalAlign(passlb, "center", false)
        guiLabelSetVerticalAlign(passlb, "center")
        usered = DGS:dgsDxCreateEdit(151, 18, 167, 32, "", false, main_win)
        passed = DGS:dgsDxCreateEdit(151, 50, 167, 32, "", false, main_win)
        statuslb = DGS:dgsDxCreateLabel(49, 96, 269, 99, "", false, main_win)
        loginbtn = DGS:dgsDxCreateButton(1, 336, 132, 40, "LOGIN", false, main_win)
        regbtn = DGS:dgsDxCreateButton(133, 336, 132, 40, "REGISTER", false, main_win)
		orlb = DGS:dgsDxCreateLabel(270, 344, 80, 32, "--OR LOGIN--", false, main_win)
        guiLabelSetHorizontalAlign(orlb, "center", false)
        guiLabelSetVerticalAlign(orlb, "center")
		ipbbtn = DGS:dgsDxCreateButton(380, 336, 200, 40, "WITH FORUM ACCOUNT", false, main_win)
        players_on = DGS:dgsDxCreateGridList(360, 17, 223, 188, false, main_win)
        update_notes = DGS:dgsDxCreateLabel(360, 97, 223, 155, "", false, main_win)
		DGS:dgsSetSize(statuslb, 6)
		showCursor(true)		
    end

-- Login GUI click events
addEventHandler("onClientDgsDxMouseClick",root,function()
	if source == loginbtn then
		DGS:dgsDxGUISetText(statuslb, "Attempting to login... please wait")
		fadeCamera(false, 1)
		triggerServerEvent("attemptClientLogin", localPlayer, DGS:dgsDxGUIGetText(usered), DGS:dgsDxGUIGetText(passed))
	-- On registration
	elseif source == ipbbtn then
		triggerServerEvent("onIPB", localPlayer, DGS:dgsDxGUIGetText(usered), DGS:dgsDxGUIGetText(passed))
	elseif source == regbtn then
	local password = DGS:dgsDxGUIGetText(passed)
	local username = DGS:dgsDxGUIGetText(usered)
	if (#password == 0) then
			DGS:dgsDxGUISetText(statuslb, "Enter a Password")
		elseif (#password < 6 or #password > 30) then
			DGS:dgsDxGUISetText(statuslb, "Password Must be\n6-30 Characters Long")
			DGS:dgsDxGUISetProperty(statuslb,"#ff0000",tocolor(255, 0, 0))
		elseif (string.find(password, "%s")) then
			DGS:dgsDxGUISetText(statuslb, "Your password cannot\n contain a space!")
			DGS:dgsDxGUISetProperty(statuslb,"#ff0000",tocolor(255, 0, 0))
		elseif (password == username) then
			DGS:dgsDxGUISetText(statuslb,"Your username and \npassword must be different!")
			DGS:dgsDxGUISetProperty(statuslb,"#ffff00",tocolor(255, 255, 0))
		else
		triggerServerEvent("onClientAttemptRegistration", localPlayer, DGS:dgsDxGUIGetText(usered), DGS:dgsDxGUIGetText(passed))
		end
	end
end)

DGS:dgsDxGUISetText works fine but when I add DGS:dgsDxGUISetProperty it wont change the label color...

any help with that?

  • Like 2
Link to comment
  On 02/06/2017 at 16:08, Senpai said:

function login_panel()
local screenW, screenH = guiGetScreenSize()
        main_win = DGS:dgsDxCreateWindow((screenW - 616) / 2, (screenH - 402) / 2, 616, 402, "", false)
        DGS:dgsDxWindowSetSizable(main_win, false)

        userlb = DGS:dgsDxCreateLabel(6, 18, 145, 32, "USERNAME:", false, main_win)
        guiLabelSetHorizontalAlign(userlb, "center", false)
        guiLabelSetVerticalAlign(userlb, "center")
        passlb = DGS:dgsDxCreateLabel(6, 50, 145, 32, "PASSWORD", false, main_win)
        guiLabelSetHorizontalAlign(passlb, "center", false)
        guiLabelSetVerticalAlign(passlb, "center")
        usered = DGS:dgsDxCreateEdit(151, 18, 167, 32, "", false, main_win)
        passed = DGS:dgsDxCreateEdit(151, 50, 167, 32, "", false, main_win)
        statuslb = DGS:dgsDxCreateLabel(49, 96, 269, 99, "", false, main_win)
        loginbtn = DGS:dgsDxCreateButton(1, 336, 132, 40, "LOGIN", false, main_win)
        regbtn = DGS:dgsDxCreateButton(133, 336, 132, 40, "REGISTER", false, main_win)
		orlb = DGS:dgsDxCreateLabel(270, 344, 80, 32, "--OR LOGIN--", false, main_win)
        guiLabelSetHorizontalAlign(orlb, "center", false)
        guiLabelSetVerticalAlign(orlb, "center")
		ipbbtn = DGS:dgsDxCreateButton(380, 336, 200, 40, "WITH FORUM ACCOUNT", false, main_win)
        players_on = DGS:dgsDxCreateGridList(360, 17, 223, 188, false, main_win)
        update_notes = DGS:dgsDxCreateLabel(360, 97, 223, 155, "", false, main_win)
		DGS:dgsSetSize(statuslb, 6)
		showCursor(true)		
    end

-- Login GUI click events
addEventHandler("onClientDgsDxMouseClick",root,function()
	if source == loginbtn then
		DGS:dgsDxGUISetText(statuslb, "Attempting to login... please wait")
		fadeCamera(false, 1)
		triggerServerEvent("attemptClientLogin", localPlayer, DGS:dgsDxGUIGetText(usered), DGS:dgsDxGUIGetText(passed))
	-- On registration
	elseif source == ipbbtn then
		triggerServerEvent("onIPB", localPlayer, DGS:dgsDxGUIGetText(usered), DGS:dgsDxGUIGetText(passed))
	elseif source == regbtn then
	local password = DGS:dgsDxGUIGetText(passed)
	local username = DGS:dgsDxGUIGetText(usered)
	if (#password == 0) then
			DGS:dgsDxGUISetText(statuslb, "Enter a Password")
		elseif (#password < 6 or #password > 30) then
			DGS:dgsDxGUISetText(statuslb, "Password Must be\n6-30 Characters Long")
			DGS:dgsDxGUISetProperty(statuslb,"#ff0000",tocolor(255, 0, 0))
		elseif (string.find(password, "%s")) then
			DGS:dgsDxGUISetText(statuslb, "Your password cannot\n contain a space!")
			DGS:dgsDxGUISetProperty(statuslb,"#ff0000",tocolor(255, 0, 0))
		elseif (password == username) then
			DGS:dgsDxGUISetText(statuslb,"Your username and \npassword must be different!")
			DGS:dgsDxGUISetProperty(statuslb,"#ffff00",tocolor(255, 255, 0))
		else
		triggerServerEvent("onClientAttemptRegistration", localPlayer, DGS:dgsDxGUIGetText(usered), DGS:dgsDxGUIGetText(passed))
		end
	end
end)

DGS:dgsDxGUISetText works fine but when I add DGS:dgsDxGUISetProperty it wont change the label color...

any help with that?

Expand  

Thx pro

@Senpai

GUIEditor = {
    edit = {}
}
addEventHandler("onClientResourceStart", resourceRoot,
    function()
        GUIEditor.edit[1] = guiCreateEdit(481, 341, 651, 43, "", false)


        GUIEditor.edit[2] = guiCreateEdit(481, 474, 651, 43, "", false)
        guiEditSetMasked(GUIEditor.edit[2], true)    
    end
)

local dxfont0_LK = dxCreateFont(":guieditorr/fonts/LK.ttf", 30)

addEventHandler("onClientRender", root,
    function()
        dxDrawImage(0, 0, 1440, 900, "images/Window.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
        dxDrawRectangle(352, 225, 784, 40, tocolor(252, 14, 2, 200), false)
        dxDrawRectangle(353, 265, 783, 424, tocolor(65, 188, 166, 200), false)
        dxDrawText("Login", 367, 620, 512, 689, tocolor(255, 255, 255, 255), 2.00, "bankgothic", "left", "top", false, false, false, false, false)
        dxDrawText("Register", 876, 609, 1069, 689, tocolor(255, 255, 255, 255), 2.00, "bankgothic", "left", "top", false, false, false, false, false)
        dxDrawText("BY ismaeel", 660, 218, 846, 265, tocolor(255, 255, 255, 255), 1.00, dxfont0_LK, "left", "top", false, false, false, false, false)
        dxDrawImage(368, 330, 93, 86, "images/username.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
        dxDrawImage(366, 460, 105, 87, "images/password.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
        dxCreateButton(367,620,512,689,"Hello!",tocolor(255,0,0,255),"default-bold","Orange")
    end
)

Hi, Can I help it What else do you do? Can you program the Dx login panel? Please

Link to comment
  On 02/06/2017 at 16:58, Ismaeel_finer said:

Thx pro

@Senpai


GUIEditor = {
    edit = {}
}
addEventHandler("onClientResourceStart", resourceRoot,
    function()
        GUIEditor.edit[1] = guiCreateEdit(481, 341, 651, 43, "", false)


        GUIEditor.edit[2] = guiCreateEdit(481, 474, 651, 43, "", false)
        guiEditSetMasked(GUIEditor.edit[2], true)    
    end
)

local dxfont0_LK = dxCreateFont(":guieditorr/fonts/LK.ttf", 30)

addEventHandler("onClientRender", root,
    function()
        dxDrawImage(0, 0, 1440, 900, "images/Window.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
        dxDrawRectangle(352, 225, 784, 40, tocolor(252, 14, 2, 200), false)
        dxDrawRectangle(353, 265, 783, 424, tocolor(65, 188, 166, 200), false)
        dxDrawText("Login", 367, 620, 512, 689, tocolor(255, 255, 255, 255), 2.00, "bankgothic", "left", "top", false, false, false, false, false)
        dxDrawText("Register", 876, 609, 1069, 689, tocolor(255, 255, 255, 255), 2.00, "bankgothic", "left", "top", false, false, false, false, false)
        dxDrawText("BY ismaeel", 660, 218, 846, 265, tocolor(255, 255, 255, 255), 1.00, dxfont0_LK, "left", "top", false, false, false, false, false)
        dxDrawImage(368, 330, 93, 86, "images/username.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
        dxDrawImage(366, 460, 105, 87, "images/password.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
        dxCreateButton(367,620,512,689,"Hello!",tocolor(255,0,0,255),"default-bold","Orange")
    end
)

Hi, Can I help it What else do you do? Can you program the Dx login panel? Please

Expand  

what do you mean by "Can you program the Dx login panel?..." 

Do you mean with MTA DX or thisdps dx gui system?

Link to comment
  On 02/06/2017 at 17:16, Senpai said:

what do you mean by "Can you program the Dx login panel?..." 

Do you mean with MTA DX or thisdps dx gui system?

Expand  
GUIEditor = {
    edit = {}
}
addEventHandler("onClientResourceStart", resourceRoot,
    function()
        GUIEditor.edit[1] = guiCreateEdit(481, 341, 651, 43, "", false)


        GUIEditor.edit[2] = guiCreateEdit(481, 474, 651, 43, "", false)
        guiEditSetMasked(GUIEditor.edit[2], true)    
    end
)

local dxfont0_LK = dxCreateFont(":guieditorr/fonts/LK.ttf", 30)

addEventHandler("onClientRender", root,
    function()
        dxDrawImage(0, 0, 1440, 900, "images/Window.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
        dxDrawRectangle(352, 225, 784, 40, tocolor(252, 14, 2, 200), false)
        dxDrawRectangle(353, 265, 783, 424, tocolor(65, 188, 166, 200), false)
        dxDrawText("Login", 367, 620, 512, 689, tocolor(255, 255, 255, 255), 2.00, "bankgothic", "left", "top", false, false, false, false, false)
        dxDrawText("Register", 876, 609, 1069, 689, tocolor(255, 255, 255, 255), 2.00, "bankgothic", "left", "top", false, false, false, false, false)
        dxDrawText("BY ismaeel", 660, 218, 846, 265, tocolor(255, 255, 255, 255), 1.00, dxfont0_LK, "left", "top", false, false, false, false, false)
        dxDrawImage(368, 330, 93, 86, "images/username.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
        dxDrawImage(366, 460, 105, 87, "images/password.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
        dxCreateButton(367,620,512,689,"Hello!",tocolor(255,0,0,255),"default-bold","Orange")
    end
)

What you advise me to do؟

Link to comment
  • Scripting Moderators
  On 02/06/2017 at 16:08, Senpai said:

function login_panel()
local screenW, screenH = guiGetScreenSize()
        main_win = DGS:dgsDxCreateWindow((screenW - 616) / 2, (screenH - 402) / 2, 616, 402, "", false)
        DGS:dgsDxWindowSetSizable(main_win, false)

        userlb = DGS:dgsDxCreateLabel(6, 18, 145, 32, "USERNAME:", false, main_win)
        guiLabelSetHorizontalAlign(userlb, "center", false)
        guiLabelSetVerticalAlign(userlb, "center")
        passlb = DGS:dgsDxCreateLabel(6, 50, 145, 32, "PASSWORD", false, main_win)
        guiLabelSetHorizontalAlign(passlb, "center", false)
        guiLabelSetVerticalAlign(passlb, "center")
        usered = DGS:dgsDxCreateEdit(151, 18, 167, 32, "", false, main_win)
        passed = DGS:dgsDxCreateEdit(151, 50, 167, 32, "", false, main_win)
        statuslb = DGS:dgsDxCreateLabel(49, 96, 269, 99, "", false, main_win)
        loginbtn = DGS:dgsDxCreateButton(1, 336, 132, 40, "LOGIN", false, main_win)
        regbtn = DGS:dgsDxCreateButton(133, 336, 132, 40, "REGISTER", false, main_win)
		orlb = DGS:dgsDxCreateLabel(270, 344, 80, 32, "--OR LOGIN--", false, main_win)
        guiLabelSetHorizontalAlign(orlb, "center", false)
        guiLabelSetVerticalAlign(orlb, "center")
		ipbbtn = DGS:dgsDxCreateButton(380, 336, 200, 40, "WITH FORUM ACCOUNT", false, main_win)
        players_on = DGS:dgsDxCreateGridList(360, 17, 223, 188, false, main_win)
        update_notes = DGS:dgsDxCreateLabel(360, 97, 223, 155, "", false, main_win)
		DGS:dgsSetSize(statuslb, 6)
		showCursor(true)		
    end

-- Login GUI click events
addEventHandler("onClientDgsDxMouseClick",root,function()
	if source == loginbtn then
		DGS:dgsDxGUISetText(statuslb, "Attempting to login... please wait")
		fadeCamera(false, 1)
		triggerServerEvent("attemptClientLogin", localPlayer, DGS:dgsDxGUIGetText(usered), DGS:dgsDxGUIGetText(passed))
	-- On registration
	elseif source == ipbbtn then
		triggerServerEvent("onIPB", localPlayer, DGS:dgsDxGUIGetText(usered), DGS:dgsDxGUIGetText(passed))
	elseif source == regbtn then
	local password = DGS:dgsDxGUIGetText(passed)
	local username = DGS:dgsDxGUIGetText(usered)
	if (#password == 0) then
			DGS:dgsDxGUISetText(statuslb, "Enter a Password")
		elseif (#password < 6 or #password > 30) then
			DGS:dgsDxGUISetText(statuslb, "Password Must be\n6-30 Characters Long")
			DGS:dgsDxGUISetProperty(statuslb,"#ff0000",tocolor(255, 0, 0))
		elseif (string.find(password, "%s")) then
			DGS:dgsDxGUISetText(statuslb, "Your password cannot\n contain a space!")
			DGS:dgsDxGUISetProperty(statuslb,"#ff0000",tocolor(255, 0, 0))
		elseif (password == username) then
			DGS:dgsDxGUISetText(statuslb,"Your username and \npassword must be different!")
			DGS:dgsDxGUISetProperty(statuslb,"#ffff00",tocolor(255, 255, 0))
		else
		triggerServerEvent("onClientAttemptRegistration", localPlayer, DGS:dgsDxGUIGetText(usered), DGS:dgsDxGUIGetText(passed))
		end
	end
end)

DGS:dgsDxGUISetText works fine but when I add DGS:dgsDxGUISetProperty it wont change the label color...

any help with that?

Expand  

nonono ,not this.

DGS:dgsDxGUISetProperty(label,key,value)

key = "textcolor"

value = color

 

and You should do

DGS:dgsDxGUISetProperty(label,"textcolor,0xFF0000FF)

or

DGS:dgsDxGUISetProperty(label,"textcolor,tocolor(255,0,0,255))

  On 02/06/2017 at 16:08, Senpai said:

function login_panel()
local screenW, screenH = guiGetScreenSize()
        main_win = DGS:dgsDxCreateWindow((screenW - 616) / 2, (screenH - 402) / 2, 616, 402, "", false)
        DGS:dgsDxWindowSetSizable(main_win, false)

        userlb = DGS:dgsDxCreateLabel(6, 18, 145, 32, "USERNAME:", false, main_win)
        guiLabelSetHorizontalAlign(userlb, "center", false)
        guiLabelSetVerticalAlign(userlb, "center")
        passlb = DGS:dgsDxCreateLabel(6, 50, 145, 32, "PASSWORD", false, main_win)
        guiLabelSetHorizontalAlign(passlb, "center", false)
        guiLabelSetVerticalAlign(passlb, "center")
        usered = DGS:dgsDxCreateEdit(151, 18, 167, 32, "", false, main_win)
        passed = DGS:dgsDxCreateEdit(151, 50, 167, 32, "", false, main_win)
        statuslb = DGS:dgsDxCreateLabel(49, 96, 269, 99, "", false, main_win)
        loginbtn = DGS:dgsDxCreateButton(1, 336, 132, 40, "LOGIN", false, main_win)
        regbtn = DGS:dgsDxCreateButton(133, 336, 132, 40, "REGISTER", false, main_win)
		orlb = DGS:dgsDxCreateLabel(270, 344, 80, 32, "--OR LOGIN--", false, main_win)
        guiLabelSetHorizontalAlign(orlb, "center", false)
        guiLabelSetVerticalAlign(orlb, "center")
		ipbbtn = DGS:dgsDxCreateButton(380, 336, 200, 40, "WITH FORUM ACCOUNT", false, main_win)
        players_on = DGS:dgsDxCreateGridList(360, 17, 223, 188, false, main_win)
        update_notes = DGS:dgsDxCreateLabel(360, 97, 223, 155, "", false, main_win)
		DGS:dgsSetSize(statuslb, 6)
		showCursor(true)		
    end

-- Login GUI click events
addEventHandler("onClientDgsDxMouseClick",root,function()
	if source == loginbtn then
		DGS:dgsDxGUISetText(statuslb, "Attempting to login... please wait")
		fadeCamera(false, 1)
		triggerServerEvent("attemptClientLogin", localPlayer, DGS:dgsDxGUIGetText(usered), DGS:dgsDxGUIGetText(passed))
	-- On registration
	elseif source == ipbbtn then
		triggerServerEvent("onIPB", localPlayer, DGS:dgsDxGUIGetText(usered), DGS:dgsDxGUIGetText(passed))
	elseif source == regbtn then
	local password = DGS:dgsDxGUIGetText(passed)
	local username = DGS:dgsDxGUIGetText(usered)
	if (#password == 0) then
			DGS:dgsDxGUISetText(statuslb, "Enter a Password")
		elseif (#password < 6 or #password > 30) then
			DGS:dgsDxGUISetText(statuslb, "Password Must be\n6-30 Characters Long")
			DGS:dgsDxGUISetProperty(statuslb,"#ff0000",tocolor(255, 0, 0))
		elseif (string.find(password, "%s")) then
			DGS:dgsDxGUISetText(statuslb, "Your password cannot\n contain a space!")
			DGS:dgsDxGUISetProperty(statuslb,"#ff0000",tocolor(255, 0, 0))
		elseif (password == username) then
			DGS:dgsDxGUISetText(statuslb,"Your username and \npassword must be different!")
			DGS:dgsDxGUISetProperty(statuslb,"#ffff00",tocolor(255, 255, 0))
		else
		triggerServerEvent("onClientAttemptRegistration", localPlayer, DGS:dgsDxGUIGetText(usered), DGS:dgsDxGUIGetText(passed))
		end
	end
end)

DGS:dgsDxGUISetText works fine but when I add DGS:dgsDxGUISetProperty it wont change the label color...

any help with that?

Expand  

Yyou shouldn't use gui* functions on my dgs, because they are different things.

guiLabelSetHorizontalAlign and guiLabelSetVerticalAlign in dgs is dgsDxGUISetProperty(label,"rightbottom",{"center","center"})

Link to comment
  On 03/06/2017 at 04:01, thisdp said:

nonono ,not this.

DGS:dgsDxGUISetProperty(label,key,value)

key = "textcolor"

value = color

 

and You should do

DGS:dgsDxGUISetProperty(label,"textcolor,0xFF0000FF)

or

DGS:dgsDxGUISetProperty(label,"textcolor,tocolor(255,0,0,255))

Yyou shouldn't use gui* functions on my dgs, because they are different things.

guiLabelSetHorizontalAlign and guiLabelSetVerticalAlign in dgs is dgsDxGUISetProperty(label,"rightbottom",{"center","center"})

Expand  

Was fixing that, but thanks for the heads up and info!

Link to comment
  • Scripting Moderators
  On 05/06/2017 at 12:55, Senpai said:

Was fixing that, but thanks for the heads up and info!

Expand  

I lost a quotation mark. The correct one is

DGS:dgsDxGUISetProperty(label,"textcolor",0xFF0000FF)

or

DGS:dgsDxGUISetProperty(label,"textcolor",tocolor(255,0,0,255))

 

I just want more scripter to use my system xD

Edited by thisdp
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...