Jump to content

Search box problem


Recommended Posts

Hello I have a search box problem you can see it on the video

The problem :

 

 

 

the code:

n_nova = {
	{"البنك [✈]",1481.08887,-1762.94910,18.7957},
	{"مهمة البنك [✈]",589.76153,-1243.05187,17.92252},
	{"مرقى [✈]",-2045.40332, -3135.07373, 4.99000},
               {"مسبح [✈]",-3374.37329, -2100.28369, 5.00000 },
	{"المدينة الصناعية [✈]",2762.0681152344, -2389.3217773438, 13.6328125},
	{"الشاطئ [✈]",253.8177947998, -1810.9669189453, 4.3108253479004},
	{"المرقـص [✈]",-3294.71924, -2298.75537, 5.00000 },
	{"الورشـة [✈]",-3136.55054,-2222.82227,5.05153},
	{"ساحة القتال [✈]",-2918.34180, -2726.62793, 9.89688},
	{"شارع الطويل [✈]",-3258.67212,-3006.19702 , 5.00000},
	{"شارع التطويف [✈]",-2318.91064,-3086.81518, 5.00000},
	{"شارع العوشزية [✈]",-496.6276550293, 591.74462890625, 17.019058227539},
	{"شارع الفروسيه [✈]",2878.1115722656, -1110.029296875, 10.882762908936},
	{"شارع المحطة [✈]",-1311.6459960938, 2674.9191894531, 50.064270019531},
	{"شارع الدخل [✈]",1332.46301,-1412.89074,13.54520},
	{"شارع الحفريات [✈]",-2935.8588867188, -1368.9516601563, 11.714294433594},
	{"شارع البستان [✈]",2491.12109375, -1667.4482421875, 13.34375},
	{"تطعيس [✈]",-2461.22387,-2946.62255 , 5.00000},
	{"الدائري [✈]",1792.79541,2393.04248 ,7.90996},
	{"النخـيل [✈]",2068.72119, 907.06708, 8.17013},
	{"الـشرقي [✈]",1054.6721191406,2729.0747070313 ,14.15293},
	{"الـغربي [✈]",1187.9227294922, 1354.2520751953, 8.7430381774902},
	{"الــغروب [✈]",662.55310058594, 1936.7479248047, 5.5052728652954},
	{"الجسر المعلق [✈]",-2665.73437,1404.73669,55.8125},
	{"معرض السيارات [✈]",-1661.35559,1211.80078,7.25},
	{"مقر الجيش [✈]",83.86812,1920.88134,17.73764},
	{"المطار الاول ( 1 ) [✈]",1396.12707,-2469.34716,13.55468},
	{"المطار الثاني ( 2 ) [✈]",-1666.00500,-155.27819,14.14843},
	{"المطار الثالث ( 3 ) [✈]",1504.62731,1158.70458,10.8125},
	{"مطار الجيش ( 4 ) [✈]",427.59286,2530.47485,16.63177},
}

GUIEditor = {
    gridlist = {},
    window = {},
    button = {},
    edit = {}
}
local screenW, screenH = guiGetScreenSize()
wnd = guiCreateWindow((screenW - 362) / 2, (screenH - 559) / 2, 362, 559, "الانتقالات", false)
guiWindowSetSizable(wnd, false)
guiSetVisible(wnd,false)
n_ova = guiCreateButton(106, 491, 150, 58, "انتقال", false, wnd)
g_nova = guiCreateGridList(35, 92, 290, 373, false, wnd)
guiGridListAddColumn(g_nova, "#", 0.9)
B7th = guiCreateEdit(35, 43, 290, 34, "", false, wnd)

bindKey("F4","down",
	function ()
		if guiGetVisible(wnd) then
			guiSetVisible(wnd,false)
			showCursor(false)
		else
			guiSetVisible(wnd,true)
			showCursor(true)
		end
	end
)


addEventHandler( "onClientGUIChanged", B7th,
function()
    guiGridListClear( g_nova )
    local Text = guiGetText( source )
    for _, Table in ipairs( n_nova ) do
        if ( string.find( Table[1], Text, 1, true ) ) then
            local Row = guiGridListAddRow( g_nova )
            guiGridListSetItemText( g_nova, Row, 1, Table[1], false, false )
            guiGridListSetItemData( g_nova, Row, 1, Table[2] )
            guiGridListSetItemColor( g_nova, Row, 1,0, 144, 255)
        end
    end
end )
---------------------------------------
for i,ha in ipairs(n_nova) do
	local row = guiGridListAddRow(g_nova)
	guiGridListSetItemText(g_nova,row,1,ha[1],false,false)
	guiGridListSetItemData(g_nova,row,1,{ha[2],ha[3],ha[4]})
end




addEventHandler("onClientGUIClick",root,
	function ()
		local sel = guiGridListGetSelectedItem(g_nova)
		if source == n_ova then
			if sel ~= -1 then
				local x,y,z = unpack(guiGridListGetItemData(g_nova,sel,1))
				setElementPosition(localPlayer,x,y,z)
			else
				outputChatBox("* ألــرجآء اختيار مكآن للآنتقال اليه",255,0,0)
			end
		end
	end
)

 

Link to comment
n_nova = {
	{"البنك [✈]",1481.08887,-1762.94910,18.7957},
	{"مهمة البنك [✈]",589.76153,-1243.05187,17.92252},
	{"مرقى [✈]",-2045.40332, -3135.07373, 4.99000},
               {"مسبح [✈]",-3374.37329, -2100.28369, 5.00000 },
	{"المدينة الصناعية [✈]",2762.0681152344, -2389.3217773438, 13.6328125},
	{"الشاطئ [✈]",253.8177947998, -1810.9669189453, 4.3108253479004},
	{"المرقـص [✈]",-3294.71924, -2298.75537, 5.00000 },
	{"الورشـة [✈]",-3136.55054,-2222.82227,5.05153},
	{"ساحة القتال [✈]",-2918.34180, -2726.62793, 9.89688},
	{"شارع الطويل [✈]",-3258.67212,-3006.19702 , 5.00000},
	{"شارع التطويف [✈]",-2318.91064,-3086.81518, 5.00000},
	{"شارع العوشزية [✈]",-496.6276550293, 591.74462890625, 17.019058227539},
	{"شارع الفروسيه [✈]",2878.1115722656, -1110.029296875, 10.882762908936},
	{"شارع المحطة [✈]",-1311.6459960938, 2674.9191894531, 50.064270019531},
	{"شارع الدخل [✈]",1332.46301,-1412.89074,13.54520},
	{"شارع الحفريات [✈]",-2935.8588867188, -1368.9516601563, 11.714294433594},
	{"شارع البستان [✈]",2491.12109375, -1667.4482421875, 13.34375},
	{"تطعيس [✈]",-2461.22387,-2946.62255 , 5.00000},
	{"الدائري [✈]",1792.79541,2393.04248 ,7.90996},
	{"النخـيل [✈]",2068.72119, 907.06708, 8.17013},
	{"الـشرقي [✈]",1054.6721191406,2729.0747070313 ,14.15293},
	{"الـغربي [✈]",1187.9227294922, 1354.2520751953, 8.7430381774902},
	{"الــغروب [✈]",662.55310058594, 1936.7479248047, 5.5052728652954},
	{"الجسر المعلق [✈]",-2665.73437,1404.73669,55.8125},
	{"معرض السيارات [✈]",-1661.35559,1211.80078,7.25},
	{"مقر الجيش [✈]",83.86812,1920.88134,17.73764},
	{"المطار الاول ( 1 ) [✈]",1396.12707,-2469.34716,13.55468},
	{"المطار الثاني ( 2 ) [✈]",-1666.00500,-155.27819,14.14843},
	{"المطار الثالث ( 3 ) [✈]",1504.62731,1158.70458,10.8125},
	{"مطار الجيش ( 4 ) [✈]",427.59286,2530.47485,16.63177},
}

GUIEditor = {
    gridlist = {},
    window = {},
    button = {},
    edit = {}
}
local screenW, screenH = guiGetScreenSize()
wnd = guiCreateWindow((screenW - 362) / 2, (screenH - 559) / 2, 362, 559, "الانتقالات", false)
guiWindowSetSizable(wnd, false)
guiSetVisible(wnd,false)
n_ova = guiCreateButton(106, 491, 150, 58, "انتقال", false, wnd)
g_nova = guiCreateGridList(35, 92, 290, 373, false, wnd)
guiGridListAddColumn(g_nova, "#", 0.9)
B7th = guiCreateEdit(35, 43, 290, 34, "", false, wnd)

bindKey("F4","down",
	function ()
		if guiGetVisible(wnd) then
			guiSetVisible(wnd,false)
			showCursor(false)
		else
			guiSetVisible(wnd,true)
			showCursor(true)
		end
	end
)


addEventHandler( "onClientGUIChanged", B7th,
function()
    guiGridListClear( g_nova )
    local Text = guiGetText( source )
    for _, Table in ipairs( n_nova ) do
        if ( string.find( Table[1], Text, 1, true ) ) then
            local Row = guiGridListAddRow( g_nova )
	guiGridListSetItemText(g_nova,Row ,1,Table[1],false,false)
	guiGridListSetItemData(g_nova,Row ,1,{Table[2],Table[3],Table[4]})
            guiGridListSetItemColor( g_nova, Row, 1,0, 144, 255)
        end
    end
end )
---------------------------------------
for i,ha in ipairs(n_nova) do
	local row = guiGridListAddRow(g_nova)
	guiGridListSetItemText(g_nova,row,1,ha[1],false,false)
	guiGridListSetItemData(g_nova,row,1,{ha[2],ha[3],ha[4]})
end




addEventHandler("onClientGUIClick",root,
	function ()
		local sel = guiGridListGetSelectedItem(g_nova)
		if source == n_ova then
			if sel ~= -1 then
				local x,y,z = unpack(guiGridListGetItemData(g_nova,sel,1))
				setElementPosition(localPlayer,x,y,z)
			else
				outputChatBox("* ألــرجآء اختيار مكآن للآنتقال اليه",255,0,0)
			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...