Jump to content

Recommended Posts

  • Scripting Moderators
Posted (edited)
2 minutes ago, Senpai said:

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

would like to see radio button also...

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
  • Scripting Moderators
Posted (edited)
2 minutes ago, Senpai said:

either way is fine :D

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

And it will check update itself.

Edited by thisdp
  • Scripting Moderators
Posted
37 minutes ago, Senpai said:

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

would like to see radio button also...

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",...)

 

Posted
12 hours ago, 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",...)

 

thats cool...

  • Scripting Moderators
Posted
20 hours ago, Senpai said:

thats cool...

 

19 hours ago, Axel said:

That would be awesome.

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

Posted
9 hours ago, thisdp said:

 

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

will sure use it for all my scripts from now on :D

  • Scripting Moderators
Posted
Just now, Senpai said:

will sure use it for all my scripts from now on :D

Thanks for using it :D

  • Scripting Moderators
Posted
28 minutes ago, Senpai said:

will sure use it for all my scripts from now on :D

Have your dgs checked an new version ?

Posted
20 hours ago, thisdp said:

 

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

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)

  • Scripting Moderators
Posted
1 hour ago, 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)

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

16 hours ago, Senpai said:

Yes I did got it and I updated it

good. it works

Posted

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

32 minutes ago, 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

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

  • Scripting Moderators
Posted (edited)
45 minutes ago, 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

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
Posted
3 hours ago, 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)

 

Thx pro

Posted
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
Posted
50 minutes ago, 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?

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

Posted
9 hours ago, 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

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

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

Posted
5 minutes ago, 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?

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؟

  • Scripting Moderators
Posted
11 hours ago, 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?

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))

11 hours ago, 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?

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"})

Posted
On 6/2/2017 at 21: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"})

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

  • Scripting Moderators
Posted (edited)
50 minutes ago, Senpai said:

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

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
Posted
39 minutes ago, thisdp said:

I just want more scripter to use my system xD

Make support for all types of gui(tab panel, checkabox, memo, etc), and i assure you alot will use it.

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...