Jump to content

Can't use gui


stefutz101

Recommended Posts

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

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

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

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

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