MaRcell

[HELP] MARKER

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

Share this post


Link to post

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

Share this post


Link to post

yes, or false it was only for a test since with true the panel would not open only the cursor the problem is that my panel doesn't open, just open the msm cursor having true there instead of false

Share this post


Link to post

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

Share this post


Link to post
5 minutes ago, sFxMTA said:

Height

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!

Share this post


Link to post
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

Share this post


Link to post

ah got it i didn't know about this value question thank you very much !!

Share this post


Link to post

 

it hasn't worked yet the panel opens as soon as I turn on the resource and doesn't open when I pass the marker

Share this post


Link to post

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.