Jump to content

Help me in GUI editor


Amine b

Recommended Posts

Hello Guys, i need some help in my GUI Editor,i want when i HitTheMarker ,a Window comes for me showing me the Car that i can Spawn Them outside,i have one,but i get spawned only one Car and without GUI ,SS : http://i.imgur.com/A26G3qH.jpg and http://i.imgur.com/PQCXzae.jpg

but i want my GUI to Become like this http://i.imgur.com/Tcd1NFh.png when i press "Infernus" i get an Infernus Car,or "......"

here is TheMarker

  
  
local marker = createMarker( 1464.9000244141, -83.099998474121, 19.10000038147  , "cylinder", 1.5, 0 ,0, 128, 155) 
  
function vehicle(thePlayer) 
    if getElementType(thePlayer) == "player" then 
    if isPedInVehicle(thePlayer)==true then return end 
         if isElement( veh ) then destroyElement( veh ) end 
     local x,y,z = getElementPosition(thePlayer) 
         veh = createVehicle(522, x,y,z) 
         warpPedIntoVehicle(thePlayer, veh) 
end 
end 
addEventHandler("onMarkerHit", marker, vehicle) 

GUIEditor = { 
    button = {}, 
    window = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        GUIEditor.window[1] = guiCreateWindow(818, 280, 319, 593, "Car Spawner By Amine ", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        guiSetAlpha(GUIEditor.window[1], 0.73) 
        guiSetProperty(GUIEditor.window[1], "CaptionColour", "FF000000") 
  
  
        GUIEditor.button[1] = guiCreateButton(853, 320, 246, 113, "", false) 
        guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") 
  
  
        GUIEditor.button[2] = guiCreateButton(854, 448, 245, 121, "", false) 
        guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA") 
  
  
        GUIEditor.button[3] = guiCreateButton(855, 585, 244, 120, "", false) 
        guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFAAAAAA") 
  
  
        GUIEditor.button[4] = guiCreateButton(854, 718, 245, 114, "", false) 
        guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FFAAAAAA")     
    end 
) 
  
addEventHandler("onClientRender", root, 
    function() 
        dxDrawText("Infernus", 879, 351, 1071, 415, tocolor(0, 0, 0, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) 
        dxDrawText("Infernus", 879, 349, 1071, 413, tocolor(0, 0, 0, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) 
        dxDrawText("Infernus", 877, 351, 1069, 415, tocolor(0, 0, 0, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) 
        dxDrawText("Infernus", 877, 349, 1069, 413, tocolor(0, 0, 0, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) 
        dxDrawText("Infernus", 878, 350, 1070, 414, tocolor(114, 0, 254, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) 
        dxDrawText("NRG-500", 893, 477, 1064, 548, tocolor(0, 0, 0, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) 
        dxDrawText("NRG-500", 893, 475, 1064, 546, tocolor(0, 0, 0, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) 
        dxDrawText("NRG-500", 891, 477, 1062, 548, tocolor(0, 0, 0, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) 
        dxDrawText("NRG-500", 891, 475, 1062, 546, tocolor(0, 0, 0, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) 
        dxDrawText("NRG-500", 892, 476, 1063, 547, tocolor(254, 0, 0, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) 
        dxDrawText("Turismo", 894, 610, 1063, 683, tocolor(0, 0, 0, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) 
        dxDrawText("Turismo", 894, 608, 1063, 681, tocolor(0, 0, 0, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) 
        dxDrawText("Turismo", 892, 610, 1061, 683, tocolor(0, 0, 0, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) 
        dxDrawText("Turismo", 892, 608, 1061, 681, tocolor(0, 0, 0, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) 
        dxDrawText("Turismo", 893, 609, 1062, 682, tocolor(101, 254, 0, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) 
        dxDrawText("Sultan", 911, 744, 1063, 816, tocolor(0, 0, 0, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) 
        dxDrawText("Sultan", 911, 742, 1063, 814, tocolor(0, 0, 0, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) 
        dxDrawText("Sultan", 909, 744, 1061, 816, tocolor(0, 0, 0, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) 
        dxDrawText("Sultan", 909, 742, 1061, 814, tocolor(0, 0, 0, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) 
        dxDrawText("Sultan", 910, 743, 1062, 815, tocolor(49, 125, 0, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) 
    end 
) 
  

My problem is Just Can Anyone ,Make Those Car inside This GUI

Infernus : ID 411

NRG : ID 522

Turismo : ID 451

Sultan : ID 560

and if you have a Youtube video About this ,told me and thx !

Link to comment

you want on marker hit, show the GUI window and create a car?

if you mean that

~# Client Side

  
  
  
GUIEditor = { 
    button = {}, 
    window = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        GUIEditor.window[1] = guiCreateWindow(818, 280, 319, 593, "Car Spawner By Amine ", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        guiSetAlpha(GUIEditor.window[1], 0.73) 
        guiSetProperty(GUIEditor.window[1], "CaptionColour", "FF000000") 
  
  
        GUIEditor.button[1] = guiCreateButton(853, 320, 246, 113, "", false) 
        guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") 
  
  
        GUIEditor.button[2] = guiCreateButton(854, 448, 245, 121, "", false) 
        guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA") 
  
  
        GUIEditor.button[3] = guiCreateButton(855, 585, 244, 120, "", false) 
        guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFAAAAAA") 
  
  
        GUIEditor.button[4] = guiCreateButton(854, 718, 245, 114, "", false) 
        guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FFAAAAAA")     
    end 
) 
  guiSetVisible (GUIEditor.window[1] , false) 
  
  
addEventHandler("onClientRender", root, 
    function() 
        dxDrawText("Infernus", 879, 351, 1071, 415, tocolor(0, 0, 0, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) 
        dxDrawText("Infernus", 879, 349, 1071, 413, tocolor(0, 0, 0, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) 
        dxDrawText("Infernus", 877, 351, 1069, 415, tocolor(0, 0, 0, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) 
        dxDrawText("Infernus", 877, 349, 1069, 413, tocolor(0, 0, 0, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) 
        dxDrawText("Infernus", 878, 350, 1070, 414, tocolor(114, 0, 254, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) 
        dxDrawText("NRG-500", 893, 477, 1064, 548, tocolor(0, 0, 0, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) 
        dxDrawText("NRG-500", 893, 475, 1064, 546, tocolor(0, 0, 0, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) 
        dxDrawText("NRG-500", 891, 477, 1062, 548, tocolor(0, 0, 0, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) 
        dxDrawText("NRG-500", 891, 475, 1062, 546, tocolor(0, 0, 0, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) 
        dxDrawText("NRG-500", 892, 476, 1063, 547, tocolor(254, 0, 0, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) 
        dxDrawText("Turismo", 894, 610, 1063, 683, tocolor(0, 0, 0, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) 
        dxDrawText("Turismo", 894, 608, 1063, 681, tocolor(0, 0, 0, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) 
        dxDrawText("Turismo", 892, 610, 1061, 683, tocolor(0, 0, 0, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) 
        dxDrawText("Turismo", 892, 608, 1061, 681, tocolor(0, 0, 0, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) 
        dxDrawText("Turismo", 893, 609, 1062, 682, tocolor(101, 254, 0, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) 
        dxDrawText("Sultan", 911, 744, 1063, 816, tocolor(0, 0, 0, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) 
        dxDrawText("Sultan", 911, 742, 1063, 814, tocolor(0, 0, 0, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) 
        dxDrawText("Sultan", 909, 744, 1061, 816, tocolor(0, 0, 0, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) 
        dxDrawText("Sultan", 909, 742, 1061, 814, tocolor(0, 0, 0, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) 
        dxDrawText("Sultan", 910, 743, 1062, 815, tocolor(49, 125, 0, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) 
    end 
) 
  
  
 local marker = createMarker( 1464.9000244141, -83.099998474121, 19.10000038147  , "cylinder", 1.5, 0 ,0, 128, 155) 
  
function giveVehicle(thePlayer) 
    if getElementType(thePlayer) == "player" then 
       guiSetVisible (GUIEditor.window[1] , true) 
    end 
end 
addEventHandler("onClientMarkerHit", marker, giveVehicle) 
  
addEventHandler ( "onClientGUIClick", root, 
function (player) 
    if getElementType(player) == "player" then 
    local x,y,z = getElementPosition(player) 
        if source == GUIEditor.button[1] then 
        local a = createVehicle ( 411 x,y,z ) -- Infernus 
        warpPedIntoVehicle(player, a) 
        guiSetVisible (GUIEditor.window[1] , false) 
        elseif source == GUIEditor.button[2] then 
        local b = createVehicle ( 522 x,y,z ) -- NRG 
        warpPedIntoVehicle(player, b) 
        guiSetVisible (GUIEditor.window[1] , false) 
        elseif source == GUIEditor.button[3] then 
        local c = createVehicle ( 451 x,y,z ) -- Turismo  
        warpPedIntoVehicle(player, c) 
        guiSetVisible (GUIEditor.window[1] , false) 
        elseif source == GUIEditor.button[4] then 
        local d = createVehicle ( 560  x,y,z ) -- Sultan 
        warpPedIntoVehicle(player, d) 
        guiSetVisible (GUIEditor.window[1] , false) 
        end 
    end 
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...