Jump to content

Help me!


Recommended Posts

Hello guys !

today im trying to make dx information panel idk why its not working can anybody help me? im noob at scripting and this is test code

addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        helpmemo = guiCreateMemo(407, 209, 585, 475, "", false)     
    end 
) 
  
addEventHandler("onClientRender", root, 
    function() 
        dxDrawRectangle(63, 143, 967, 577, tocolor(9, 9, 9, 216), false, helpwindow) 
        dxDrawRectangle(85, 494, 250, 63, tocolor(9, 9, 9, 242), false) 
        dxDrawText("Darhal noob", 85, 493, 335, 557, tocolor(255, 255, 255, 255), 3.00, "default", "left", "top", false, false, false, false, false) 
    end 
) 
  
function onClick(x, y, absX, absY) 
         if isCursorWithin(85, 493, 335, 557) then -- width , height are width height of dx draw (text / rectangle) 
        function rules () 
rulestxt = fileOpen("Rules.txt", true) 
rulestxt1 = fileRead(rulestxt, 50000) 
guiSetText(helpmemo, rulestxt1) 
end 
addEventHandler("onClientGUIClick", Rules, rules) 
 end 
end 
addEventHandler("onClientClick", root, onClick) 
  
function isCursorWithin(x, y, width, height) 
    if(not isCursorShowing()) then 
        return false; 
    end 
    local sx, sy = guiGetScreenSize(); 
    local cx, cy = getCursorPosition(); 
    local cx, cy = (cx*sx), (cy*sy); 
    if(cx >= x and cx <= x + width) and (cy >= y and cy <= y + height) then 
        return true; 
    else 
        return false; 
    end 
end 
  
function open()  
if (guiGetVisible (helpwindow) == false) then  
guiSetVisible(helpwindow, true)  
showCursor(true)  
guiSetPosition(helpwindow,x,y,false) 
centerWindow(helpwindow) 
elseif (guiGetVisible (helpwindow) == true) then  
guiSetVisible(helpwindow, false)  
showCursor(false)  
end  
end  
bindKey ("F1", "down", open)  

Link to comment
  
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        helpmemo = guiCreateMemo(407, 209, 585, 475, "", false)     
    end 
) 
  
  
    function drawDx() 
        dxDrawRectangle(63, 143, 967, 577, tocolor(9, 9, 9, 216), false) 
        dxDrawRectangle(85, 494, 250, 63, tocolor(9, 9, 9, 242), false) 
        dxDrawText("Darhal Pro <3", 85, 493, 335, 557, tocolor(255, 255, 255, 255), 3.00, "default", "left", "top", false, false, false, false, false) 
    end 
  
  
function onClick(x, y, absX, absY) 
         if isCursorWithin(85, 493, 335, 557) then -- width , height are width height of dx draw (text / rectangle) 
        function rules () 
rulestxt = fileOpen("Rules.txt", true) 
rulestxt1 = fileRead(rulestxt, 50000) 
guiSetText(helpmemo, rulestxt1) 
end 
addEventHandler("onClientGUIClick", Rules, rules) 
 end 
end 
addEventHandler("onClientClick", root, onClick) 
  
function isCursorWithin(x, y, width, height) 
    if(not isCursorShowing()) then 
        return false; 
    end 
    local sx, sy = guiGetScreenSize(); 
    local cx, cy = getCursorPosition(); 
    local cx, cy = (cx*sx), (cy*sy); 
    if(cx >= x and cx <= x + width) and (cy >= y and cy <= y + height) then 
        return true; 
    else 
        return false; 
    end 
end 
  
function open() 
if (guiGetVisible (helpmemo) == false) then 
guiSetVisible(helpmemo, true) 
showCursor(true) 
--guiSetPosition(helpmemo,x,y,false) 
centerWindow(helpmemo) 
addEventHandler("onClientRender", root,drawDx) 
elseif (guiGetVisible (helpmemo) == true) then 
guiSetVisible(helpmemo, false) 
showCursor(false) 
removeEventHandler("onClientRender", root,drawDx) 
end 
end 
bindKey ("F1", "down", open) 
  

Link to comment
function rules () 
rulestxt = fileOpen("Rules.txt", true) 
rulestxt1 = fileRead(rulestxt, 50000) 
guiSetText(helpmemo, rulestxt1) 
end 
addEventHandler("onClientGUIClick", Rules, rules) 

And what exactly is Rules supposed to be? From what I can tell it's not defined. Also use debugscript.

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