Jump to content

GUI


Arsilex

Recommended Posts

Mi problema es que cuando paso por el marker no me aparece nada :S

Client-side

addEventHandler("onClientResourceStart",resourceRoot, 
function () 
        Panel = guiCreateWindow(749,250,326,448,"Armas de Hillitop",false) 
         
         
        ColtIMG = guiCreateStaticImage(16,10,77,94,"images/22.png",false,Panel) 
        guiSetAlpha(ColtIMG,0.69999998807907) 
        Colt = guiCreateButton(21,96,111,37,"Colt-47 500$",false,Panel) 
        guiSetFont(Colt,"default-bold-small") 
         
         
         
        UziIMG = guiCreateStaticImage(186,18,82,84,"images/28.png",false,Panel) 
        guiSetAlpha(UziIMG,0.69999998807907) 
        Uzi = guiCreateButton(185,94,106,39,"Uzi 1000$",false,Panel) 
        guiSetFont(Uzi,"default-bold-small") 
         
         
        AKIMG = guiCreateStaticImage(92,147,99,141,"images/30.png",false,Panel) 
        guiSetAlpha(AKIMG,0.69999998807907) 
        AK = guiCreateButton(102,249,94,42,"AK-47 1500$",false,Panel) 
        guiSetFont(AK,"default-bold-small") 
         
         
         
        Cerrar = guiCreateButton(66,347,179,64,"Cerrar",false,Panel) 
        guiSetFont(Cerrar,"sa-header") 
end 
) 
  
addEvent("showGUI",true) 
addEventHandler("showGUI",root, 
function () 
guiSetVisible(Panel,true) 
showCursor(true) 
end) 

server-side

function pedLoad ( ) 
   local vendedor = createPed ( 107,1113.54, -317.48, 73.99 ) 
   setPedRotation(vendedor,0) 
   markergui = createMarker ( 1112.35, -316.86, 72.99, "cylinder", 2, 255, 0, 0, 255 ) 
   addEventHandler("onMarkerHit",markergui,showGUI) 
end 
addEventHandler ( "onResourceStart", resourceRoot, pedLoad ) 
  
function showGUI(hitElement) 
    if getElementType( hitElement ) == "player" then 
         triggerClientEvent(hitElement,"showGUI",hitElement) 
    end 
end 

Link to comment

Facil, estas creando el marcador cuanto lo tocas, es asi:

markergui = createMarker ( 1112.35, -316.86, 72.99, "cylinder", 2, 255, 0, 0, 255 ) 
vendedor = createPed ( 107,1113.54, -317.48, 73.99 ) 
  
function showGUI ( ) 
   setPedRotation(vendedor,0) 
    if getElementType( hitElement ) == "player" then 
         triggerClientEvent(hitElement,"showGUI",hitElement) 
end 
end 
addEventHandler("onMarkerHit",markergui,showGUI) 

Link to comment

mmm... se ve el marcador?

        Panel = guiCreateWindow(749,250,326,448,"Armas de Hillitop",false) 
         
         
        ColtIMG = guiCreateStaticImage(16,10,77,94,"images/22.png",false,Panel) 
        guiSetAlpha(ColtIMG,0.69999998807907) 
        Colt = guiCreateButton(21,96,111,37,"Colt-47 500$",false,Panel) 
        guiSetFont(Colt,"default-bold-small") 
         
         
         
        UziIMG = guiCreateStaticImage(186,18,82,84,"images/28.png",false,Panel) 
        guiSetAlpha(UziIMG,0.69999998807907) 
        Uzi = guiCreateButton(185,94,106,39,"Uzi 1000$",false,Panel) 
        guiSetFont(Uzi,"default-bold-small") 
         
         
        AKIMG = guiCreateStaticImage(92,147,99,141,"images/30.png",false,Panel) 
        guiSetAlpha(AKIMG,0.69999998807907) 
        AK = guiCreateButton(102,249,94,42,"AK-47 1500$",false,Panel) 
        guiSetFont(AK,"default-bold-small") 
         
         
         
        Cerrar = guiCreateButton(66,347,179,64,"Cerrar",false,Panel) 
        guiSetFont(Cerrar,"sa-header") 
guiSetVisible(Panel,false) 
  
markergui = createMarker ( 1112.35, -316.86, 72.99, "cylinder", 2, 255, 0, 0, 255 ) 
vendedor = createPed ( 107,1113.54, -317.48, 73.99 ) 
  
function showGUI ( ) 
guiSetVisible(true, false) 
end 
addEventHandler("onClientMarkerHit",markergui,showGUI) 

Intenta asi, todo en el Client Side

Link to comment

Estas seguro que hiciste bien el meta? Porque tu script en si muestra la gui onClientResourceStart

Lo unico que tendrias que hacer para arreglar eso es agregar un guiSetVisible (Panel, false) dentro de la funcion que crea la GUI.

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...