Jump to content

[HELP] MARKER


MaRcell

Recommended Posts

 

I am creating a script with dgs a gang panel, so that the marker does not open my panel will I have done something wrong? for me it's all right.  

obs: I don't know how to move with dgs

local screenx, screeny = guiGetScreenSize()
local sx, sy = (screenx/1920), (screeny/1080)



loadstring(exports.dgs:dgsImportFunction())()

  ------groveWindow STREET-------------
  local markergrove = createMarker ( 2498.9873046875, -1685.6142578125, 13.446597099304 -1,"cylinder", 1.5, 0 ,255 ,0 ,170)





    groveWindow= dgsCreateWindow (sx*20, sy*300, sx*300, sy*400, "GROVE STREET", true, tocolor(0 ,0 ,0), sy*30, false, tocolor(0 ,238, 0	,255), nil, tocolor(28 ,28, 28,120), 5,true)
    label= dgsCreateLabel(2, 10,100, 90,"BEM VINDO A groveWindow STREET",false,groveWindow)
    label1= dgsCreateLabel(2, 50,10, 10,"é uma das principais gang de LS",false,groveWindow)
    label2= dgsCreateLabel(2, 70,20, 20,"A GS é uma gangue de rua",false,groveWindow)
    label3= dgsCreateLabel(2, 90,20, 20,"afro-americana e uma das mais",false,groveWindow)
    label4= dgsCreateLabel(2, 110,20, 20,"antigas gangues de rua em LS",false,groveWindow)
    label5= dgsCreateLabel(2, 160,20, 20,"RIVAIS : BALLAS, VAGOS",false,groveWindow)
    buttonEntrar = dgsCreateButton(2, 210,100,40,"ENTRAR!", false, groveWindow )
    buttonSair= dgsCreateButton(100, 210,100,40,"SAIR!", false, groveWindow )

    dgsSetFont ( label, "sans" )
    dgsSetFont ( label1, "sans" )
   	dgsSetFont ( label2, "sans" )
   	dgsSetFont ( label3, "sans" )
   	dgsSetFont ( label4, "sans" )
   	dgsSetFont ( label5, "default-bold" )



 addEventHandler ("onClientMarkerHit",root,
function ()
    if (source == markergrove)  then
    dgsSetVisible(groveWindow,false)
    showCursor(true)
   
  end
end)




 

Edited by MaRcell
Link to comment

If you wanna show the panel you gotta change false to true in dgsSetVisible and put another dgsSetVisible to false right after you created your elements, otherwise if you want the opposite why are you even showing the cursor?

Btw, try to explain better what you wanna get, you got me confused with it

Edited by sFxMTA
Link to comment

I think the problem is in your X, Y, Width and Height of your window, you're using sx and sy with relative on, they are gui elements not dx, try to put something like 

groveWindow= dgsCreateWindow (0.15, 0.33, 0.7, 0.34, "GROVE STREET", true, tocolor(0 ,0 ,0), sy*30, false, tocolor(0 ,238, 0 ,255), nil, tocolor(28 ,28, 28,120), 5,true)

And see if it still doesn't shows

When you're in gui elements you don't need to calculate the screen width and height by yourself

Edited by sFxMTA
Link to comment
8 minutes ago, MaRcell said:

But without the marker, if I put the panel to appear without a marker, it appears normally so I thought it wasn’t the problem of the coordinates but I will test it thanks!

I tried it myself and the problem is actually related to position and width/height of it, use values without screen calculations, you can use guieditor to get the position and then switch from guiElement to dgsElement

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