stefutz101 Posted August 16, 2016 Share Posted August 16, 2016 Hi i have a DayZ Server , and new players what come on my server for first time , they cannot use any gui elements . Gui elements appear corectlly, no warnings or errors in debugscript. If they will connet on other dayz server ( i guess any server , i'm not sure if it's necesarry to be a Dayz server too ) and they will reconnect back , every thing is alright . They see that gui windows like some photos , they cannot click on nothing. Any help ? ( i have more resources based on gui elements no one works until they visit other server). I don't know where this problem came from . Link to comment
Gravestone Posted August 16, 2016 Share Posted August 16, 2016 Post the code of any gui you're using. Link to comment
stefutz101 Posted August 16, 2016 Author Share Posted August 16, 2016 function showPickGender() gwindow = guiCreateWindow(524, 132, 409, 279, "Select your gender", false) guiWindowSetSizable(gwindow, false) guiSetAlpha(gwindow, 0.78) guiSetVisible(gwindow, false) --------------------------------- man = guiCreateStaticImage(49, 49, 99, 192, "man.png", false, gwindow) woman = guiCreateStaticImage(262, 49, 102, 192, "woman.png", false, gwindow) text = guiCreateLabel(131, 32, 147, 17, "Please select your gender.", false, gwindow) mantext = guiCreateLabel(84, 251, 30, 18, "MAN", false, gwindow) womantext = guiCreateLabel(290, 251, 46, 18, "WOMAN", false, gwindow) ------------------------------ addEventHandler("onClientGUIClick", woman, function() triggerServerEvent("femaleChosen", localPlayer, localPlayer) showCursor(false) guiSetVisible(gwindow, false) end, false) addEventHandler("onClientGUIClick", man, function() triggerServerEvent("maleChosen", localPlayer, localPlayer) showCursor(false) guiSetVisible(gwindow, false) end, false) end addEventHandler("onClientResourceStart", resourceRoot, showPickGender) For example. Link to comment
Gravestone Posted August 16, 2016 Share Posted August 16, 2016 The code looks fine. Can you show us a screenshot of how the gui appears to the clients? Link to comment
stefutz101 Posted August 16, 2016 Author Share Posted August 16, 2016 You can't see nothing in a photo , because there isn't a difference. The problem is that : new players can't use them. I mean they cannot click on button , girds , images ... etc . If they will click on buttons for example nothing . Download this image : https://postimg.org/image/3jugop2wf/ open it and try to use any button from that photo . This is the problem . Or just try to connect on my server from signature . I think you will understand . Link to comment
Gravestone Posted August 16, 2016 Share Posted August 16, 2016 What do you mean can not click on the buttons, grids, images? Are the gui elements enabled/visible? Link to comment
stefutz101 Posted August 16, 2016 Author Share Posted August 16, 2016 Gui elements apprear like images . You simply can't use them. Link to comment
Gravestone Posted August 16, 2016 Share Posted August 16, 2016 Dude we can't understand what you are trying to say unless we see what's wrong. Link to comment
stefutz101 Posted August 16, 2016 Author Share Posted August 16, 2016 Ok. Think about this : you have a gui window with a grid list and i button(exemple). When a new player enter on my server if he want to select an item from grid list, he simply can't . It's like i have an image with a gui and it's drawed on screen using dxDrawImage. Or : if you have a window with a button on it , if you move curson over that button it will flash , ok new players from my server can't do that . Link to comment
Gravestone Posted August 16, 2016 Share Posted August 16, 2016 Maybe the image is covering the screen? Have you tried using destroyElement? Please ask your client for a screenshot and provide us with it, thanks. Link to comment
stefutz101 Posted August 16, 2016 Author Share Posted August 16, 2016 https://postimg.org/image/7d2fau149/ In first photo you can see a player what can't use gui resources , in secound photo you can see a player what can use them. Link to comment
Gravestone Posted August 16, 2016 Share Posted August 16, 2016 Most probably, there is some gui element overwriting that gui button. Link to comment
stefutz101 Posted August 16, 2016 Author Share Posted August 16, 2016 How i can solve ? Link to comment
Tomas Posted August 16, 2016 Share Posted August 16, 2016 There is something turning the button unclickable. Look for 'guiSetEnabled' or 'guiSetProperty' in the code. Link to comment
stefutz101 Posted August 17, 2016 Author Share Posted August 17, 2016 They have the same problem with grids. EDIT : i looked for that functions ... nothing. Link to comment
stefutz101 Posted August 18, 2016 Author Share Posted August 18, 2016 Found problem: local headline = {} rightclickWindow = guiCreateStaticImage(0,0,0.05,0.0215,"images/scrollmenu_1.png",true) headline["rightclickmenu"] = guiCreateLabel(0,0,1,1,"",true,rightclickWindow) guiLabelSetHorizontalAlign (headline["rightclickmenu"],"center") guiLabelSetVerticalAlign (headline["rightclickmenu"],"center") guiSetFont (headline["rightclickmenu"], "default-bold-small" ) guiSetVisible(rightclickWindow,false) function showRightClickInventoryMenu (itemName,itemInfo) if itemInfo then local screenx, screeny, worldx, worldy, worldz = getCursorPosition() guiSetVisible(rightclickWindow,true) guiSetText(headline["rightclickmenu"],itemInfo) local whith = guiLabelGetTextExtent (headline["rightclickmenu"]) guiSetPosition(rightclickWindow,screenx,screeny,true) local x,y = guiGetSize(rightclickWindow,false) guiSetSize(rightclickWindow,whith,y,false) guiBringToFront(rightclickWindow) setElementData(rightclickWindow,"iteminfo",{itemName,itemInfo}) end end function hideRightClickInventoryMenu () guiSetVisible(rightclickWindow,false) end function onPlayerClickOnRightClickMenu (button,state) if button == "left" then local itemName,itemInfo = getElementData(rightclickWindow,"iteminfo")[1],getElementData(rightclickWindow,"iteminfo")[2] hideRightClickInventoryMenu () playerUseItem(itemName,itemInfo) end end addEventHandler("onClientGUIClick",headline["rightclickmenu"],onPlayerClickOnRightClickMenu,false) Warning: local itemName,itemInfo = getElementData(rightclickWindow,"iteminfo")[1],getElementData(rightclickWindow,"iteminfo")[2] expected element at arg1 , got nil Error : local itemName,itemInfo = getElementData(rightclickWindow,"iteminfo")[1],getElementData(rightclickWindow,"iteminfo")[2] attempt to index a boolean value. Warning : guiSetVisible(rightclickWindow,false) execpted gui-element at argument 1 , got nil. PS: This is a part of script . (And i search in script if that element is destroyed , but it isn't) Link to comment
stefutz101 Posted August 19, 2016 Author Share Posted August 19, 2016 I just found the problem , that image was missing . 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