DaminkO Posted July 1, 2016 Share Posted July 1, 2016 GUIEditor = { gridlist = {}, window = {}, button = {}, label = {} } --(1541.37219, -1675.51563, 13.55242) local PlacesTable = { {"البداية ", 4598.32227,-1954.70947 ,12.80194,}, {"البنك", 1479.48999, -1707.75439, 14.04688}, {"مركز الشرطة", 1541.37219, -1675.51563, 13.55242}, {"استلام الرواتب", 2504.06787 , -1672.69263, 13.36300}, {"آلدآئري ", 1830.88538, 903.81830, 10.38969}, {"آلنخيل ", 2068.7211914063, 907.06707763672, 8.1701345443726}, {"آلطعوس ", -2617.193359375, -2547.3530273438, 3}, {"آلغروب ", 662.55310058594, 1936.7479248047, 5.5052728652954}, {"المطار الاول", 1717.6470947266, -2494.1176757813, 13.39999961853}, {"المطار الثاني", -1223.4300537109, -185.74758911133, 14.39999961853}, {"المطار الثالث", 1411.7646484375, 1482.3529052734, 10.89999961853}, {"ساحة الدرفت",1009.79254, -2322.02051, 13.09375}, {"Cinema", 154.66577, 1094.27124, 14.67220}, {"تصادم السيارات",2813.29712, -1763.30908, 10.32601}, {"الشارع الطويل",-3252.47144, -2983.04419, 5.00000}, {"آلديربي",1448.97778, -2726.81201, 10.96742}, } local screenW, screenH = guiGetScreenSize() GUIEditor.window[1] = guiCreateWindow((screenW - 352) / 2, (screenH - 422) / 2, 352, 422, "الانتقالات", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFECB00") guiSetVisible (GUIEditor.window[1],false) Places = guiCreateGridList(14, 25, 320, 326, false, GUIEditor.window[1]) guiGridListAddColumn(Places, "المكان", 0.9) GUIEditor.button[1] = guiCreateButton(11, 358, 145, 42, "انتقال", false, GUIEditor.window[1]) Close = guiCreateButton(189, 358, 145, 42, "اغلاق", false, GUIEditor.window[1]) GUIEditor.label[1] = guiCreateLabel(256, 400, 302, 15, "9.M By #Rock", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[1], "default-bold-small") for Key, Value in ipairs(PlacesTable) do local Row = guiGridListAddRow(Places) guiGridListSetItemText(Places, Row, 1, Value[1], false, false) guiGridListSetItemData(Places, Row, 1, {Value[2], Value[3], Value[4]}) end addEventHandler('onClientGUIClick', Close,function () guiSetVisible (GUIEditor.window[1],false) end ) bindKey ("F6","down", function () guiSetVisible (GUIEditor.window[1],not guiGetVisible (GUIEditor.window[1])) showCursor (guiGetVisible (GUIEditor.window[1])) end) addEventHandler ( "onClientGUIClick", GUIEditor.button[1], function () local sel = guiGridListGetSelectedItem ( Places ) if sel ~= -1 then local x,y,z = unpack(guiGridListGetItemData ( Places,sel,1 )) setElementPosition(localPlayer,x,y,z) guiSetVisible (GUIEditor.window[1],false) showCursor ( false ) end end ) ابغى اذا كان اللاعب معه موتر ينتقل Link to comment
' A F . Posted July 1, 2016 Share Posted July 1, 2016 addEventHandler("onClientGUIClick",resourceRoot, function ( ) if ( source == GUIEditor.button[1] ) then local Selected = guiGridListGetSelectedItem ( Places ) if ( Selected ~= -1 ) then local x,y,z = unpack( guiGridListGetItemData ( Places , Selected , 1 ) ) if ( getPedOccupiedVehicle ( getLocalPlayer ( ) ) ) then setElementPosition ( getPedOccupiedVehicle ( getLocalPlayer() ) , x , y , z ) else setElementPosition ( getLocalPlayer() , x , y , z ) end end end end ) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now