Jump to content

Force GUIs


Absence2

Recommended Posts

How do I "force-popup" a gui window in a player's face, then deny their access to press it down with a key? command-wise

This is my GUI window.. no idea what to do from here.

All I found was:

ForcePlayerMap 

Though, I'm not sure if that's right plus no idea how to use it.

myWindow = nil 
pressed = false 
----------------------[KEY BINDS]-------------------- 
function bindKeys() 
    bindKey("F9", "down", F9RPhelp) 
end 
addEventHandler("onClientResourceStart", getRootElement(), bindKeys) 
  
function resetState() 
    pressed = false 
end 
  
  
---------------------------[HELP]-------------------- 
function F9RPhelp( key, keyState ) 
    if not (pressed) then 
        pressed = true 
        setTimer(resetState, 200, 1) 
        if ( myWindow == nil ) then 
    myWindow = guiCreateWindow(352,185,330,401,"Server Rules", false) 
    local tabPanel = guiCreateTabPanel(9,25,312,367,false, myWindow) 
    local rules = guiCreateTab("Server Rules", tabPanel) 
    local guide = guiCreateTab("Roleplay Guide", tabPanel) 
local help = guiCreateTab("Help", tabPanel) 
local admin = guiCreateTab("Staff List", tabPanel) 
------------------ 
            local xml1 = xmlLoadFile( "rules.xml" ) 
            local contents1 = xmlNodeGetValue( xml1 ) 
            local xml2 = xmlLoadFile( "guide.xml" ) 
            local contents2 = xmlNodeGetValue( xml2 ) 
            local xml3 = xmlLoadFile( "help.xml" ) 
            local contents3 = xmlNodeGetValue( xml3 ) 
            local xml4 = xmlLoadFile( "staff.xml" ) 
            local contents4 = xmlNodeGetValue( xml4 ) 
------------------ 
            guiCreateMemo(0.03,0.03,0.94,0.95,contents1,true,rules) 
            guiCreateMemo(0.03,0.03,0.94,0.95,contents2,true,guide) 
            guiCreateMemo(0.03,0.03,0.94,0.95,contents3,true,help) 
            guiCreateMemo(0.03,0.03,0.94,0.95,contents4,true,admin) 
  
            showCursor ( true ) 
        else 
            destroyElement(myWindow) 
            myWindow = nil 
            showCursor(false) 
        end 
    end 
end 

(The GUI window) but.. then what?

Link to comment
gui window pops up the moment you create/show it. and it cannot be closed with a key, unless this functionality is scripted.

so i dont get the problem.

I'm trying to force a player to "read" it, open it for a specific player via a command then use a timer so they cannot close it until the time is up. (My guiWindow is scripted on F9).

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