Jump to content

repier code


iiAhmed

Recommended Posts

hi guys i want repier my code :)

i want on player hit marker open my windows and on click any button spwan

sorry bad english but this code

  
  
  
GUIEditor = { 
    staticimage = {}, 
    label = {}, 
    gridlist = {}, 
    combobox = {}, 
    memo = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        wnd = guiCreateWindow(431, 221, 748, 663, "FlyMTA|AirPort", false) 
        guiWindowSetSizable(wnd, false) 
        guiSetAlpha(wnd, 0.83) 
        guiSetProperty(wnd, "CaptionColour", "FF2DB4D1") 
  
        ls = guiCreateButton(9, 19, 191, 250, "LS", false, wnd) 
        guiSetFont(ls, "default-bold-small") 
        guiSetProperty(ls, "NormalTextColour", "FF89D725") 
        sf = guiCreateButton(9, 281, 191, 327, "SF", false, wnd) 
        guiSetFont(sf, "clear-normal") 
        guiSetProperty(sf, "NormalTextColour", "FF321BDF") 
        lv = guiCreateButton(202, 21, 179, 250, "LV", false, wnd) 
        guiSetFont(lv, "default-small") 
        guiSetProperty(lv, "NormalTextColour", "FF7F9F5C") 
        exit = guiCreateButton(200, 280, 181, 328, "Exit", false, wnd) 
        guiSetFont(exit, "clear-normal") 
        guiSetProperty(exit, "NormalTextColour", "FFF7062E") 
        GUIEditor.gridlist[1] = guiCreateGridList(640, 28, 98, 625, false, wnd) 
        guiGridListAddColumn(GUIEditor.gridlist[1], "AirPort Online", 0.9) 
        guiGridListAddRow(GUIEditor.gridlist[1]) 
        guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "SOON", false, false) 
        GUIEditor.label[1] = guiCreateLabel(431, 32, 195, 26, "FlyMTA V.1.0", false, wnd) 
        guiSetFont(GUIEditor.label[1], "clear-normal") 
        guiLabelSetColor(GUIEditor.label[1], 31, 211, 218) 
        GUIEditor.staticimage[1] = guiCreateStaticImage(449, 173, 118, 181, ":guieditor/images/examples/mtalogo.png", false, wnd) 
        guiSetProperty(GUIEditor.staticimage[1], "ImageColours", "tl:FF787E7C tr:FF787E7C bl:FF787E7C br:FF787E7C") 
        GUIEditor.memo[1] = guiCreateMemo(411, 373, 200, 280, "Welcome To FlyMTA !!\n\n--\n\nمرحبا بك في فلاي ام تي اي \nلاول مره في لعبه ..\n\nMTA Plus !\nAirPort Online !\nRate ! \n\n--\n\nBy Mostafa \n\n", false, wnd) 
        guiMemoSetReadOnly(GUIEditor.memo[1], true) 
        GUIEditor.label[2] = guiCreateLabel(413, 89, 126, 15, "Rate :", false, wnd) 
        guiSetFont(GUIEditor.label[2], "clear-normal") 
        guiLabelSetColor(GUIEditor.label[2], 26, 219, 158) 
        GUIEditor.combobox[1] = guiCreateComboBox(545, 91, 91, 61, "", false, wnd) 
        guiSetFont(GUIEditor.combobox[1], "clear-normal") 
        guiComboBoxAddItem(GUIEditor.combobox[1], "Bad") 
        guiComboBoxAddItem(GUIEditor.combobox[1], "Nice") 
  
        GUIEditor.label[3] = guiCreateLabel(-8, -18, 99, 18, "", false, GUIEditor.combobox[1]) 
  
        GUIEditor.staticimage[2] = guiCreateStaticImage(327, 636, 24, 17, ":guieditor/images/dx_elements/slider_end.png", false, wnd) 
        GUIEditor.staticimage[3] = guiCreateStaticImage(581, 238, 38, 38, ":guieditor/images/plus.png", false, wnd) 
        GUIEditor.label[4] = guiCreateLabel(439, 149, 133, 14, "", false, wnd) 
        GUIEditor.staticimage[4] = guiCreateStaticImage(620, 167, 10, 34, ":dxgui/images/checkboxcheck.png", false, wnd)     
    end 
) 
  
addEventHandler("onClientRender", root, 
    function() 
        dxDrawImage(1378, 331, 124, 187, ":guieditor/images/examples/mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
        dxDrawText("FlyMTA", 1381, 543, 1595, 578, tocolor(0, 0, 0, 255), 1.00, "pricedown", "left", "top", false, false, true, true, false) 
        dxDrawText("FlyMTA", 1381, 541, 1595, 576, tocolor(0, 0, 0, 255), 1.00, "pricedown", "left", "top", false, false, true, true, false) 
        dxDrawText("FlyMTA", 1379, 543, 1593, 578, tocolor(0, 0, 0, 255), 1.00, "pricedown", "left", "top", false, false, true, true, false) 
        dxDrawText("FlyMTA", 1379, 541, 1593, 576, tocolor(0, 0, 0, 255), 1.00, "pricedown", "left", "top", false, false, true, true, false) 
        dxDrawText("FlyMTA", 1380, 542, 1594, 577, tocolor(58, 233, 11, 255), 1.00, "pricedown", "left", "top", false, false, true, true, false) 
    end 
) 
  
----------------------------------------------------- 
addEventHandler(''onClientGUIClick'',root 
function () 
if (source == ls ) 
setElementPosition ( source, posX, posY, posZ ) 
outputChatBox(''FlyMTA : Welcome To LS City '' , source ) 
end 
end 
) 
-------------------------------------------------------- 
addEventHandler(''onClientGUIClick'',root 
function () 
if (source == sf ) 
setElementPosition ( source, posX, posY, posZ ) 
outputChatBox(''FlyMTA : Welcome To SF City '' , source ) 
end 
end 
) 
---------------------------------------------------------- 
addEventHandler(''onClientGUIClick'',root 
function () 
if (source == lv ) 
setElementPosition ( source, posX, posY, posZ ) 
outputChatBox(''FlyMTA : Welcome To LV City '' , source ) 
end 
end 
) 
  
------------------------------------------------------------- 
local Marker1 = createMarker ( x, y, x, "cylinder", 2, 0, 125, 125, 125 )   
addEventHandler(''onClientMarkerHit'',root 
guiSetVisble(wnd,true) 
end 
) 
  
  

Link to comment

Anyway, As i can see, GUI will show up everytime this resource will start, so you may add in the first function (that creates the GUI)

1. guiSetVisible(wnd,false) -- on resource start it will create and hide it...

and sorry if you did type this and i didn't realize...

2. in the last function, line 99:

addEventHandler("onClientMarkerHit",root, < change 'root' with Marker1 so GUI will show up when hitting Marker1.

3. Use ( " " ) instead of ( ' ' ' ' )

Link to comment
  • Moderators

- Use double quote (") instead of 2 single quotes (' ')

- Use tabs for indentation instead of spaces (spaces are automatically removed on this forum)

- You forgot function() at line 96.

- This gui will be fine for only one resolution (convert it to use relative positioning and sizing) :!:

GUIEditor = { 
    staticimage = {}, 
    label = {}, 
    gridlist = {}, 
    combobox = {}, 
    memo = {} 
} 
  
addEventHandler("onClientResourceStart", resourceRoot, 
function() 
    wnd = guiCreateWindow(431, 221, 748, 663, "FlyMTA|AirPort", false) 
    guiWindowSetSizable(wnd, false) 
    guiSetAlpha(wnd, 0.83) 
    guiSetProperty(wnd, "CaptionColour", "FF2DB4D1") 
  
    ls = guiCreateButton(9, 19, 191, 250, "LS", false, wnd) 
    guiSetFont(ls, "default-bold-small") 
    guiSetProperty(ls, "NormalTextColour", "FF89D725") 
    sf = guiCreateButton(9, 281, 191, 327, "SF", false, wnd) 
    guiSetFont(sf, "clear-normal") 
    guiSetProperty(sf, "NormalTextColour", "FF321BDF") 
    lv = guiCreateButton(202, 21, 179, 250, "LV", false, wnd) 
    guiSetFont(lv, "default-small") 
    guiSetProperty(lv, "NormalTextColour", "FF7F9F5C") 
    exit = guiCreateButton(200, 280, 181, 328, "Exit", false, wnd) 
    guiSetFont(exit, "clear-normal") 
    guiSetProperty(exit, "NormalTextColour", "FFF7062E") 
    GUIEditor.gridlist[1] = guiCreateGridList(640, 28, 98, 625, false, wnd) 
    guiGridListAddColumn(GUIEditor.gridlist[1], "AirPort Online", 0.9) 
    guiGridListAddRow(GUIEditor.gridlist[1]) 
    guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "SOON", false, false) 
    GUIEditor.label[1] = guiCreateLabel(431, 32, 195, 26, "FlyMTA V.1.0", false, wnd) 
    guiSetFont(GUIEditor.label[1], "clear-normal") 
    guiLabelSetColor(GUIEditor.label[1], 31, 211, 218) 
    GUIEditor.staticimage[1] = guiCreateStaticImage(449, 173, 118, 181, ":guieditor/images/examples/mtalogo.png", false, wnd) 
    guiSetProperty(GUIEditor.staticimage[1], "ImageColours", "tl:FF787E7C tr:FF787E7C bl:FF787E7C br:FF787E7C") 
    GUIEditor.memo[1] = guiCreateMemo(411, 373, 200, 280, "Welcome To FlyMTA !!\n\n--\n\nمرحبا بك في فلاي ام تي اي \nلاول مره في لعبه ..\n\nMTA Plus !\nAirPort Online !\nRate ! \n\n--\n\nBy Mostafa \n\n", false, wnd) 
    guiMemoSetReadOnly(GUIEditor.memo[1], true) 
    GUIEditor.label[2] = guiCreateLabel(413, 89, 126, 15, "Rate :", false, wnd) 
    guiSetFont(GUIEditor.label[2], "clear-normal") 
    guiLabelSetColor(GUIEditor.label[2], 26, 219, 158) 
    GUIEditor.combobox[1] = guiCreateComboBox(545, 91, 91, 61, "", false, wnd) 
    guiSetFont(GUIEditor.combobox[1], "clear-normal") 
    guiComboBoxAddItem(GUIEditor.combobox[1], "Bad") 
    guiComboBoxAddItem(GUIEditor.combobox[1], "Nice") 
  
    GUIEditor.label[3] = guiCreateLabel(-8, -18, 99, 18, "", false, GUIEditor.combobox[1]) -- dafuq ? 
  
    GUIEditor.staticimage[2] = guiCreateStaticImage(327, 636, 24, 17, ":guieditor/images/dx_elements/slider_end.png", false, wnd) 
    GUIEditor.staticimage[3] = guiCreateStaticImage(581, 238, 38, 38, ":guieditor/images/plus.png", false, wnd) 
    GUIEditor.label[4] = guiCreateLabel(439, 149, 133, 14, "", false, wnd) 
    GUIEditor.staticimage[4] = guiCreateStaticImage(620, 167, 10, 34, ":dxgui/images/checkboxcheck.png", false, wnd)     
end) 
  
addEventHandler("onClientRender", root, 
function() 
    dxDrawImage(1378, 331, 124, 187, ":guieditor/images/examples/mtalogo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) 
    dxDrawText("FlyMTA", 1381, 543, 1595, 578, tocolor(0, 0, 0, 255), 1.00, "pricedown", "left", "top", false, false, true, true, false) 
    dxDrawText("FlyMTA", 1381, 541, 1595, 576, tocolor(0, 0, 0, 255), 1.00, "pricedown", "left", "top", false, false, true, true, false) 
    dxDrawText("FlyMTA", 1379, 543, 1593, 578, tocolor(0, 0, 0, 255), 1.00, "pricedown", "left", "top", false, false, true, true, false) 
    dxDrawText("FlyMTA", 1379, 541, 1593, 576, tocolor(0, 0, 0, 255), 1.00, "pricedown", "left", "top", false, false, true, true, false) 
    dxDrawText("FlyMTA", 1380, 542, 1594, 577, tocolor(58, 233, 11, 255), 1.00, "pricedown", "left", "top", false, false, true, true, false) 
end) 
  
----------------------------------------------------- 
addEventHandler("onClientGUIClick", root 
function () 
    if (source == ls ) 
        setElementPosition ( source, posX, posY, posZ ) 
        outputChatBox("FlyMTA : Welcome To LS City " , source ) 
        guiSetVisble(wnd, false) 
    end 
end) 
-------------------------------------------------------- 
addEventHandler("onClientGUIClick", root 
function () 
    if (source == sf ) 
        setElementPosition ( source, posX, posY, posZ ) 
        outputChatBox("FlyMTA : Welcome To SF City " , source ) 
        guiSetVisble(wnd, false) 
    end 
end) 
---------------------------------------------------------- 
addEventHandler("onClientGUIClick", root 
function () 
    if (source == lv ) 
        setElementPosition ( source, posX, posY, posZ ) 
        outputChatBox("FlyMTA : Welcome To LV City " , source ) 
        guiSetVisble(wnd, false) 
    end 
end) 
------------------------------------------------------------- 
local Marker1 = createMarker ( x, y, x, "cylinder", 2, 0, 125, 125, 125 )   
addEventHandler("onClientMarkerHit", Marker1 
function() 
    guiSetVisble(wnd, true) 
end) 

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