Jump to content

[help] CreateWindow


IceBrasill

Recommended Posts

Posted
local myMarker = createMarker(1358.8127441406,1679.6812744141,9.8203125, 'cylinder', 2.0, 255, 0, 0, 150) 
local myBlip = createBlip( 1358.8127441406,1679.6812744141,9.8203125 ) 
  
GUIEditor = { 
    button = {}, 
    window = {} 
} 
function MarkerHit( hitElement, matchingDimension ) 
    local elementType = getElementType( hitElement ) 
        janela = guiCreateWindow (237, 146, 149, 206, "Aeroporto Las Venturas", false) 
        guiWindowSetSizable(janela, false) 
        guiSetAlpha(janela, 1.00) 
        GUIEditor.button[1] = guiCreateButton(9, 29, 130, 28, "Ilha Perdida", false, janela) 
    addEventHandler ( "onClientGUIClick", GUIEditor.button[1], click1, false ) 
        guiSetFont(GUIEditor.button[1], "default-bold-small") 
        GUIEditor.button[2] = guiCreateButton(9, 72, 130, 28, "New City", false, janela) 
        guiSetFont(GUIEditor.button[2], "default-bold-small")     
end 
addEventHandler( "onMarkerHit", myMarker, MarkerHit ) 
  
function click1 ( button, p ) 
  
  guiSetVisible ( janela, false ) 
  showCursor ( false ) 
    setElementPosition ( p, 1, 1, 1 ) 
end  
addEventHandler ( "onClientClick", getRootElement(), click1 ) 

the window is not created upon entering the marker

Posted
local myMarker = createMarker(1358.8127441406,1679.6812744141,9.8203125, 'cylinder', 2.0, 255, 0, 0, 150) 
local myBlip = createBlip( 1358.8127441406,1679.6812744141,9.8203125 ) 
  
GUIEditor = { 
    button = {}, 
    window = {} 
} 
function MarkerHit( hitElement, matchingDimension ) 
    local elementType = getElementType( hitElement ) 
     
        GUIEditor.window[1] = guiCreateWindow (237, 146, 149, 206, "Aeroporto Las Venturas", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        guiSetAlpha(GUIEditor.window[1], 1.00) 
        outputChatBox('Object Created !',255,255,0) 
        GUIEditor.button[1] = guiCreateButton(9, 29, 130, 28, "Ilha Perdida", false, GUIEditor.window[1]) 
    addEventHandler ( "onClientGUIClick", GUIEditor.button[1], click1, false ) 
        guiSetFont(GUIEditor.button[1], "default-bold-small") 
        GUIEditor.button[2] = guiCreateButton(9, 72, 130, 28, "New City", false, GUIEditor.window[1]) 
        guiSetFont(GUIEditor.button[2], "default-bold-small")    
  showCursor ( true )        
end 
addEventHandler( "onClientMarkerHit", myMarker, MarkerHit ) 

dont work

Posted

Client Side

  
addEvent("MarkerHit", true) 
addEventHandler( "MarkerHit", localPlayer, 
function () 
        window = guiCreateWindow (237, 146, 149, 206, "Aeroporto Las Venturas", false) 
        guiWindowSetSizable(window, false) 
        guiSetVisible(window, true) 
        outputChatBox('Object Created !',255,255,0) 
        button1 = guiCreateButton(9, 29, 130, 28, "Ilha Perdida", false, window) 
        guiSetFont(button1, "default-bold-small") 
        showCursor ( true )       
    end 
end) 
  
function click1 () 
    button2 = guiCreateButton(9, 72, 130, 28, "New City", false, window) 
    guiSetFont(button2, "default-bold-small") 
end 
addEventHandler ( "onClientGUIClick", button1, click1, true ) 
  

Server Side

  
local myMarker = createMarker(1358.8127441406,1679.6812744141,9.8203125, 'cylinder', 2.0, 255, 0, 0, 150) 
local myBlip = createBlip( 1358.8127441406,1679.6812744141,9.8203125 ) 
function HitMarker ( hitElement ) 
    if getElementType ( hitElement ) == "player" then 
        triggerClientEvent( source, "MarkerHit", source) 
    else 
        outputChatBox("Get out of the car", hitElement, 255,255,255,true) 
    end 
end 
addEventHandler("onMarkerHit", myMarker, HitMarker) 
  

Posted
attempt to call global 'guiCreateWindow' (a nil value) 

Oh wait that?

Are you sure the meta.xml somehow looks like this:

  
<meta> 
           <script src="yourscriptname.lua" type="client" /> 
</meta> 
  

Posted

mym eta:

    type="script" version="1.0.0">
  
    "BASE-SNIPERS.map" dimension="0">
  
    

my script:

local myMarker = createMarker(1358.8127441406,1679.6812744141,9.8203125, 'cylinder', 2.0, 255, 0, 0, 150) 
local myBlip = createBlip( 1358.8127441406,1679.6812744141,9.8203125 ) 
  
GUIEditor = { 
    button = {}, 
    window = {} 
} 
function MarkerHit( hitElement, matchingDimension ) 
    local elementType = getElementType( hitElement ) 
    
        GUIEditor.window[1] = guiCreateWindow (237, 146, 149, 206, "Aeroporto Las Venturas", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        guiSetAlpha(GUIEditor.window[1], 1.00) 
        outputChatBox('Object Created !',255,255,0) 
        GUIEditor.button[1] = guiCreateButton(9, 29, 130, 28, "Ilha Perdida", false, GUIEditor.window[1]) 
    addEventHandler ( "onClientGUIClick", GUIEditor.button[1], click1, false ) 
        guiSetFont(GUIEditor.button[1], "default-bold-small") 
        GUIEditor.button[2] = guiCreateButton(9, 72, 130, 28, "New City", false, GUIEditor.window[1]) 
        guiSetFont(GUIEditor.button[2], "default-bold-small")   
  showCursor ( true )       
end 
addEventHandler( "onClientMarkerHit", myMarker, MarkerHit ) 
  
function click1 ( button, p ) 
  
  guiSetVisible ( janela, false ) 
  showCursor ( false ) 
    setElementPosition ( p, 1, 1, 1 ) 
end  
addEventHandler ( "onClientClick", getRootElement(), click1 ) 

Posted
  
local myMarker = createMarker(1358.8127441406,1679.6812744141,9.8203125, 'cylinder', 2.0, 255, 0, 0, 150) 
local myBlip = createBlip( 1358.8127441406,1679.6812744141,9.8203125 ) 
  
GUIEditor = { 
    button = {}, 
    window = {} 
} 
function MarkerHit( hitElement, matchingDimension ) 
    local elementType = getElementType( hitElement ) 
    
        GUIEditor.window[1] = guiCreateWindow (237, 146, 149, 206, "Aeroporto Las Venturas", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        guiSetAlpha(GUIEditor.window[1], 1.00) 
        outputChatBox('Object Created !',255,255,0) 
        GUIEditor.button[1] = guiCreateButton(9, 29, 130, 28, "Ilha Perdida", false, GUIEditor.window[1]) 
    addEventHandler ( "onClientGUIClick", GUIEditor.button[1], click1, false ) 
        guiSetFont(GUIEditor.button[1], "default-bold-small") 
        GUIEditor.button[2] = guiCreateButton(9, 72, 130, 28, "New City", false, GUIEditor.window[1]) 
        guiSetFont(GUIEditor.button[2], "default-bold-small")   
  showCursor ( true )       
end 
addEventHandler( "onClientMarkerHit", myMarker, MarkerHit ) 
  
function click1 ( button ) 
  
  guiSetVisible ( janela, false ) 
  showCursor ( false ) 
    setElementPosition ( localPlayer 1, 1, 1 ) 
end 
addEventHandler ( "onClientGUIClick", buttonName, click1 ) 
  

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