Jump to content

What Should I edited in this?(CLOSED)


Jaysds1

Recommended Posts

What should I edited in here? I created a gui with 2 buttons that should be linked to spawning a player.

addEventHandler("onClientResourceStart",resourceRoot, 
    function() 
        GUIEditor_Window = {} 
        GUIEditor_Button = {} 
        GUIEditor_Edit = {} 
        GUIEditor_Progress = {} 
  
        GUIEditor_Window[1] = guiCreateWindow(33,174,149,276,"Teams",false) 
guiSetAlpha(GUIEditor_Window[1],1) 
        GUIEditor_Button[2] = guiCreateButton(46,172,67,31,"Freeroamer",false,GUIEditor_Window[1]) 
guiSetAlpha(GUIEditor_Button[2],1) 
        GUIEditor_Edit[1] = guiCreateEdit(36,39,92,43,"Select a Team",false,GUIEditor_Window[1]) 
guiSetAlpha(GUIEditor_Edit[1],1) 
guiEditSetReadOnly(GUIEditor_Edit[1],true) 
        GUIEditor_Progress[1] = guiCreateProgressBar(24,238,112,29,false,GUIEditor_Window[1]) 
guiSetAlpha(GUIEditor_Progress[1],1) 
guiProgressBarSetProgress(GUIEditor_Progress[1],100) 
    end 
) 

Edited by Guest
Link to comment
  • Moderators

you have to add this event onClientGUIClick after the creation of your 2 buttons ( and where is your 1st button ? ^^ ):

function spawnFreeroamer() 
    outputChatBox("Spawn Freeroamer" ) 
    -- you can hide your windows: 
    guiSetVisible( GUIEditor_Window[1], false ) 
end 
  
addEventHandler("onClientResourceStart",resourceRoot, 
    function() 
        GUIEditor_Window = {} 
        GUIEditor_Button = {} 
        GUIEditor_Edit = {} 
        GUIEditor_Progress = {} 
  
        GUIEditor_Window[1] = guiCreateWindow(33,174,149,276,"Teams",false) 
        guiSetAlpha(GUIEditor_Window[1],1) 
        GUIEditor_Button[2] = guiCreateButton(46,172,67,31,"Freeroamer",false,GUIEditor_Window[1]) 
        guiSetAlpha(GUIEditor_Button[2],1) 
        GUIEditor_Edit[1] = guiCreateEdit(36,39,92,43,"Select a Team",false,GUIEditor_Window[1]) 
        guiSetAlpha(GUIEditor_Edit[1],1) 
        guiEditSetReadOnly(GUIEditor_Edit[1],true) 
        GUIEditor_Progress[1] = guiCreateProgressBar(24,238,112,29,false,GUIEditor_Window[1]) 
        guiSetAlpha(GUIEditor_Progress[1],1) 
        guiProgressBarSetProgress(GUIEditor_Progress[1],100) 
        -- execute spawnFreeroamer() if the GUIEditor_Button[2] is clicked: 
        addEventHandler ( "onClientGUIClick", GUIEditor_Button[2], spawnFreeroamer, false ) 
    end 
) 

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