Resulcan Posted July 26, 2020 Share Posted July 26, 2020 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', getResourceRootElement( getThisResource( ) ), onClickSuicide, false) The Person Is Not Dying Help? Link to comment
Moderators IIYAMA Posted July 26, 2020 Moderators Share Posted July 26, 2020 You can't use killPed on a player clientside. Only serverside. Read the docs: https://wiki.multitheftauto.com/wiki/KillPed Instead (or kill the player serverside, which I would recommend you to do -> prevent strange animation bugs): setElementHealth(localPlayer, 0) Link to comment
Resulcan Posted July 26, 2020 Author Share Posted July 26, 2020 (edited) Clicking the button player it did not die Edited July 26, 2020 by Resulcan Link to comment
Moderators IIYAMA Posted July 26, 2020 Moderators Share Posted July 26, 2020 (edited) 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 July 26, 2020 by IIYAMA Link to comment
Resulcan Posted July 27, 2020 Author Share Posted July 27, 2020 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 (255, 270, 205, 110,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 IIYAMA Posted July 27, 2020 Moderators Share Posted July 27, 2020 2 hours ago, Resulcan said: playerList = dgs:dgsCreateGridList (255, 270, 205, 110,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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now