Jump to content

[Help]DGS


Resulcan

Recommended Posts

local dgs = exports.dgs 
 
local sw,sh = guiGetScreenSize()
local px,py = sw/1920,sh/1080
 
local window = dgs:dgsCreateWindow(((sw -1420)/2)*px,((sh-450)/2)*py,290*px,370*py,'KAFES GAMİNG F1 PANEL',false)
local Olme = dgs:dgsCreateButton(10,2,195,35,'Dead',false,window)
 
--------------------Ölme
function onClickSuicide()
  killPed(localPlayer)
end
addEventHandler('onDgsMouseClick'getResourceRootElementgetThisResource( ) ), onClickSuicide, false)
 
 
The Person Is Not Dying Help?
Link to comment
  • Moderators
41 minutes ago, Resulcan said:

Clicking the button player it did not die

Yes, you forgot to explain that... But it wasn't that hard to figure that one out.

I answered your question for the most part.

 

You also need to enable propagation:

addEventHandler('onDgsMouseClick', getResourceRootElement( getThisResource( ) ), onClickSuicide, true) 

Not sure why you did change that setting without knowing what it is for.

addEventHandler('onDgsMouseClick', getResourceRootElement( getThisResource( ) ), onClickSuicide, true)

And even better, attach the event to your button element:

addEventHandler('onDgsMouseClick', Olme, onClickSuicide) 

 

 

Edited by IIYAMA
Link to comment
7 hours ago, IIYAMA said:

Yes, you forgot to explain that... But it wasn't that hard to figure that one out.

I answered your question for the most part.

 

You also need to enable propagation:


addEventHandler('onDgsMouseClick', getResourceRootElement( getThisResource( ) ), onClickSuicide, true) 

Not sure why you did change that setting without knowing what it is for.

addEventHandler('onDgsMouseClick', getResourceRootElement( getThisResource( ) ), onClickSuicide, true)

And even better, attach the event to your button element:


addEventHandler('onDgsMouseClick', Olme, onClickSuicide) 

 

 

local Karakte = dgs:dgsCreateWindow(255,250,210,310,"Karakter",false)
playerList = dgs:dgsCreateGridList (255270205110,false )  ---------------------------------How can we adjust the color
local column = dgs:dgsGridListAddColumn( playerList, "Player"0.5 ) 
for id, player in ipairs(getElementsByType("player")) do
    local row = dgs:dgsGridListAddRow ( playerList )
    dgs:dgsGridListSetItemText ( playerList, row, column, getPlayerName ( player ) )
end
Link to comment
  • Moderators
2 hours ago, Resulcan said:

playerList = dgs:dgsCreateGridList (255270205110,false )  ---------------------------------How can we adjust the color

Search on this page with the word: color

And you will find what you are looking for per element.

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