Jump to content

No gui-window


gerlachmax98

Recommended Posts

client:

function SubmitAbbrechenBtn( button ) 
    guiSetVisible(GUIEditor.window[1],false) 
    showCursor(false) 
    triggerServerEvent ( "cancel_gui_server", lp ) 
end 
  
GUIEditor.window[1] = {} 
  
function createGui () 
local screenwidth, screenheight = guiGetScreenSize () 
  
    GUIEditor.window[1] = guiCreateWindow(screenwidth/2-411,screenheight/2-285/2,411, 285, "miau", false) 
    guiWindowSetSizable(GUIEditor.window[1], false) 
  
    GUIEditor.label[1] = guiCreateLabel(-10, 32, 434, 15, "miau", false, GUIEditor.window[1]) 
    guiLabelSetHorizontalAlign(GUIEditor.label[1], "center", false) 
  
    GUIEditor.label[2] = guiCreateLabel(-21, 11, 15, 15, "", false, GUIEditor.label[1]) 
  
    GUIEditor.label[3] = guiCreateLabel(30, 69, 357, 15, "miau", false, GUIEditor.window[1]) 
    GUIEditor.label[4] = guiCreateLabel(28, 86, 360, 18, "miau", false, GUIEditor.window[1]) 
  
    GUIEditor.label[5] = guiCreateLabel(0, 18, 354, 16, "", false, GUIEditor.label[4]) 
  
    GUIEditor.label[6] = guiCreateLabel(26, 104, 363, 18, "miau", false, GUIEditor.window[1]) 
    guiLabelSetHorizontalAlign(GUIEditor.label[6], "center", false) 
    GUIEditor.label[7] = guiCreateLabel(25, 123, 364, 19, "miau.", false, GUIEditor.window[1]) 
    guiLabelSetHorizontalAlign(GUIEditor.label[7], "center", false) 
    GUIEditor.label[8] = guiCreateLabel(109, 50, 201, 15, "miau.", false, GUIEditor.window[1]) 
    guiLabelSetHorizontalAlign(GUIEditor.label[8], "center", false) 
    GUIEditor.label[9] = guiCreateLabel(36, 161, 336, 20, "miau", false, GUIEditor.window[1]) 
    guiLabelSetColor(GUIEditor.label[9], 222, 101, 20) 
    guiLabelSetHorizontalAlign(GUIEditor.label[9], "center", false) 
    GUIEditor.button[1] = guiCreateButton(99, 191, 210, 53, "miau", false, GUIEditor.window[1]) 
    GUIEditor.button[2]Schliessen = guiCreateButton(328, 260, 73, 15, "Schliessen", false, GUIEditor.window[1])    
addEventHandler("onClientGUIClick", GUIEditor.button[2]Schliessen, SubmitAbbrechenBtn, true)     
end 
addEvent ( "_createGui", true ) 
addEventHandler ( "_createGui", getRootElement (), createGui ) 

server:

markerzurpruefung = createMarker ( 1173.176, 1348.323, 10.922, "cylinder", 1, 255, 0, 0, 170 ) 
  
function pruefung_marker ( marker ) 
    local player = source 
    if getPedOccupiedVehicle ( player ) == false then 
        if marker == markerzurpruefung then 
            triggerClientEvent ( player, "_createGui" , player ) 
            showCursor ( player, true) 
        end 
    end  
end 
addEventHandler ( "onPlayerMarkerHit", getRootElement (), pruefung_marker) 

Error:

chDGf.png

Help me :cry:

Link to comment
triggerServerEvent ( "cancel_gui_server", ip ) -- ip ?? 

v

triggerServerEvent ( "cancel_gui_server", localPlayer ) 

* Note : ^ This event is not added in server side because that i well remove this line from client side !

-- Client Side !

function SubmitAbbrechenBtn() 
    guiSetVisible(GUIEditor.window[1],false) 
    showCursor(false) 
end 
  
GUIEditor = { 
    button = {}, 
    label = {}, 
    window = {}, 
} 
  
function createGui () 
    local screenwidth, screenheight = guiGetScreenSize () 
  
    GUIEditor.window[1] = guiCreateWindow(screenwidth/2-411,screenheight/2-285/2,411, 285, "miau", false) 
    guiWindowSetSizable(GUIEditor.window[1], false) 
  
    GUIEditor.label[1] = guiCreateLabel(-10, 32, 434, 15, "miau", false, GUIEditor.window[1]) 
    guiLabelSetHorizontalAlign(GUIEditor.label[1], "center", false) 
  
    GUIEditor.label[2] = guiCreateLabel(-21, 11, 15, 15, "", false, GUIEditor.label[1]) 
  
    GUIEditor.label[3] = guiCreateLabel(30, 69, 357, 15, "miau", false, GUIEditor.window[1]) 
    GUIEditor.label[4] = guiCreateLabel(28, 86, 360, 18, "miau", false, GUIEditor.window[1]) 
  
    GUIEditor.label[5] = guiCreateLabel(0, 18, 354, 16, "", false, GUIEditor.label[4]) 
  
    GUIEditor.label[6] = guiCreateLabel(26, 104, 363, 18, "miau", false, GUIEditor.window[1]) 
    guiLabelSetHorizontalAlign(GUIEditor.label[6], "center", false) 
    GUIEditor.label[7] = guiCreateLabel(25, 123, 364, 19, "miau.", false, GUIEditor.window[1]) 
    guiLabelSetHorizontalAlign(GUIEditor.label[7], "center", false) 
    GUIEditor.label[8] = guiCreateLabel(109, 50, 201, 15, "miau.", false, GUIEditor.window[1]) 
    guiLabelSetHorizontalAlign(GUIEditor.label[8], "center", false) 
    GUIEditor.label[9] = guiCreateLabel(36, 161, 336, 20, "miau", false, GUIEditor.window[1]) 
    guiLabelSetColor(GUIEditor.label[9], 222, 101, 20) 
    guiLabelSetHorizontalAlign(GUIEditor.label[9], "center", false) 
    GUIEditor.button[1] = guiCreateButton(99, 191, 210, 53, "miau", false, GUIEditor.window[1]) 
    GUIEditor.button[2] = guiCreateButton(328, 260, 73, 15, "Schliessen", false, GUIEditor.window[1])   
    addEventHandler("onClientGUIClick", GUIEditor.button[2], SubmitAbbrechenBtn, true)    
end 
addEvent ( "_createGui", true ) 
addEventHandler ( "_createGui", getRootElement (), createGui ) 

 

-- Server Side !

 

markerzurpruefung = createMarker ( 1173.176, 1348.323, 10.922, "cylinder", 1, 255, 0, 0, 170 ) 
  
function pruefung_marker ( marker ) 
    local player = source 
    if not isPedInVehicle ( player ) then 
        if marker == markerzurpruefung then 
            triggerClientEvent ( player, "_createGui", player ) 
            showCursor ( player, true ) 
        end 
    end  
end 
addEventHandler ( "onPlayerMarkerHit", root, pruefung_marker ) 

Edited by Guest
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...