Jump to content

Gui help


Wei

Recommended Posts

how can i make my gui open when i type in /admin command.

Here is my code (unfinished)

window1 = guiCreateWindow(268,214,530,216,"Blazy's Admin Panel! Use /admin to close!",false) 
button1 = guiCreateButton(10,27,164,82,"Flying cars ON",false,window1) 
guiSetFont(button1,"sa-header") 
button2 = guiCreateButton(356,118,159,86,"Admin Base",false,window1) 
guiSetFont(button2,"sa-header") 
button3 = guiCreateButton(184,118,164,82,"Hoover cars off",false,window1) 
guiSetFont(button3,"sa-header") 
button4 = guiCreateButton(12,117,164,82,"Flying cars off",false,window1) 
guiSetFont(button4,"sa-header") 
button5 = guiCreateButton(354,26,164,82,"Admin Godmode",false,window1) 
guiSetFont(button5,"sa-header") 
button6 = guiCreateButton(182,26,164,82,"Hoover Cars On",false,window1) 
guiSetFont(button6,"sa-header") 
  
function flyingcars(thePlayer) 
  
setWorldSpecialPropertyEnabled("aircars", true) 
end 
  
addEventHandler("onClientGUIClick", button1, flyingcars) 
  
function flyingcar(thePlayer) 
  
setWorldSpecialPropertyEnabled("aircars", false) 
end 
  
addEventHandler("onClientGUIClick", button2, flyingcar) 

Link to comment
window1 = guiCreateWindow(268,214,530,216,"Blazy's Admin Panel! Use /admin to close!",false) 
guiSetVisible ( window1, false ) 
button1 = guiCreateButton(10,27,164,82,"Flying cars ON",false,window1) 
guiSetFont(button1,"sa-header") 
button2 = guiCreateButton(356,118,159,86,"Admin Base",false,window1) 
guiSetFont(button2,"sa-header") 
button3 = guiCreateButton(184,118,164,82,"Hoover cars off",false,window1) 
guiSetFont(button3,"sa-header") 
button4 = guiCreateButton(12,117,164,82,"Flying cars off",false,window1) 
guiSetFont(button4,"sa-header") 
button5 = guiCreateButton(354,26,164,82,"Admin Godmode",false,window1) 
guiSetFont(button5,"sa-header") 
button6 = guiCreateButton(182,26,164,82,"Hoover Cars On",false,window1) 
guiSetFont(button6,"sa-header") 
  
addCommandHandler ( "admin", 
    function ( ) 
        guiSetVisible ( window1, not guiGetVisible ( window1 ) ) 
        showCursor ( guiGetVisible ( window1 ) ) 
    end 
) 
  
function flyingcars ( ) 
    setWorldSpecialPropertyEnabled ( "aircars", true ) 
end 
addEventHandler ( "onClientGUIClick", button1, flyingcars ) 
  
function flyingcar ( ) 
    setWorldSpecialPropertyEnabled ( "aircars", false ) 
end 
addEventHandler ( "onClientGUIClick", button2, flyingcar ) 

Link to comment

Just 1 help more. I didn't open new post.

function Staffbaseport ( thePlayer ) 
    setElementPosition((thePlayer), 110.53934, 1104.70752, 13.60938) 
end 
addEventHandler ( "onClientGUIClick", button2, Staffbaseport (thePlayer) ) 

whats the problem here ?

Link to comment

how can I bind that on F1 ?

(this is not all of GUI)

GUIEditor_Window = {} 
GUIEditor_Label = {} 
  
GUIEditor_Window[1] = guiCreateWindow(195,125,693,475,"SHG Help Manager",false) 
guiSetVisible ( GUIEditor_Window[1], false ) 
guiWindowSetSizable(GUIEditor_Window[1],false) 
GUIEditor_Label[35] = guiCreateLabel(394,318,254,47,"SHG GAMING",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[35],"sa-header") 
GUIEditor_Label[36] = guiCreateLabel(438,375,167,45,"SERVER",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[36],"sa-header") 
  

Link to comment
  
GUIEditor_Window = {} 
GUIEditor_Label = {} 
  
GUIEditor_Window[1] = guiCreateWindow(195,125,693,475,"SHG Help Manager",false) 
guiSetVisible ( GUIEditor_Window[1], false ) 
guiWindowSetSizable(GUIEditor_Window[1],false) 
GUIEditor_Label[35] = guiCreateLabel(394,318,254,47,"SHG GAMING",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[35],"sa-header") 
GUIEditor_Label[36] = guiCreateLabel(438,375,167,45,"SERVER",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Label[36],"sa-header") 
  
function Window() 
    if (guiGetVisible(GUIEditor_Window[1]) == true) then 
        guiSetVisible(GUIEditor_Window[1], false) 
        showCursor(false) 
    else 
        guiSetVisible(GUIEditor_Window[1], true) 
        showCursor(true) 
    end 
end 
bindKey("F1","down",Window) 
  

Link to comment

Another Ploblem.

If I press close it doesn't close.

Code:

bike_spawn_window = guiCreateWindow(376,202,232,329,"SHG Bike Spawner",false) 
guiWindowSetSizable(bike_spawn_window,false) 
guiSetVisible ( bike_spawn_window, false ) 
bmx_button = guiCreateButton(9,28,213,66,"BMX",false,bike_spawn_window) 
guiSetFont(bmx_button,"sa-header") 
close_button = guiCreateButton(18,248,203,66,"Close",false,bike_spawn_window) 
guiSetFont(close_button,"sa-header") 
mountain_bike_button = guiCreateButton(15,174,208,66,"Mountain bike",false,bike_spawn_window) 
guiSetFont(mountain_bike_button,"sa-header") 
bike_button = guiCreateButton(13,100,207,66,"Bike",false,bike_spawn_window) 
guiSetFont(bike_button,"sa-header") 
  
  
policemarker = createMarker ( 1538.97107, -1686.05786, 13.54688, "cylinder", 1, 255, 255, 255, 100 ) 
  
  
function Window() 
    if (guiGetVisible(bike_spawn_window) == true) then 
        guiSetVisible(bike_spawn_window, false) 
        showCursor(false) 
    else 
        guiSetVisible(bike_spawn_window, true) 
        showCursor(true) 
    end 
end 
addEventHandler ( "onClientMarkerHit", policemarker, Window ) 
addEventHandler ( "onClientGuiClick", close_button, Window ) 
  

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