The Killer Posted August 21, 2015 Share Posted August 21, 2015 function fetchMaps ( ) local Maps_ = { } for k, v in ipairs( getResources ( ) ) do if ( getResourceInfo( v, "type" ) == "map" and getResourceInfo( v, "gamemodes" ) == "race" )then table.insert ( Maps_, getResourceInfo( v, "name" ) ) end end return Maps_ end addEvent ("GetMaps", true) addEventHandler ("GetMaps", root, function () local Maps = fetchMaps () triggerClientEvent (source, "addMaps_", source, Maps) end ) addEvent ("searchForIt", true) addEventHandler ("searchForIt", root, function (mapName) local maps = fetchMaps () triggerClientEvent (source, "ReplyFromServer", source, mapName, maps) end ) addEvent ("getMapsBack", true) addEventHandler ("getMapsBack", root, function () local maps = fetchMaps () triggerClientEvent (source, "getAllMaps", source, maps) end ) addEvent ("nextM", true) addEventHandler ("nextM", root, function (map) executeCommandHandler ("nextmap", source, map) end ) Link to comment
N3xT Posted August 21, 2015 Author Share Posted August 21, 2015 صرت ما اقدر ابحث الحين attempt to index local 'v' (a boolean value) if string.find (v:lower (), mapName:lower ()) then Link to comment
The Killer Posted August 21, 2015 Share Posted August 21, 2015 كيف ما تقدر تبحث ؟ انا شغال عندي ويبحث ومافيه مشاكل ! Link to comment
N3xT Posted August 21, 2015 Author Share Posted August 21, 2015 كيف ما تقدر تبحث ؟ انا شغال عندي ويبحث ومافيه مشاكل ! اذا رجعته على getResourceName يبحث ، واذا غيرته للأسم اللي بالميتا م يبحث Link to comment
The Killer Posted August 21, 2015 Share Posted August 21, 2015 انت لا تعدله بس انسخه وحطه زي كذا: addEventHandler ("onClientResourceStart", resourceRoot, function () triggerServerEvent ("GetMaps", localPlayer) end ) addEventHandler ("onClientGUIClick", resourceRoot, function () if (source == GUIEditor.button[2]) then local row = guiGridListGetSelectedItem (GUIEditor.gridlist[1]) local select = guiGridListGetItemText (GUIEditor.gridlist[1], row, 1) if (select and select ~= "") then triggerServerEvent ("nextM", localPlayer, select) end end end ) addEvent ("addMaps_", true) addEventHandler ("addMaps_", root, function (maps) guiGridListClear (GUIEditor.gridlist[1]) for _,v in ipairs (maps) do local row = guiGridListAddRow (GUIEditor.gridlist[1]) guiGridListSetItemText (GUIEditor.gridlist[1], row, 1, v, false, false) end end ) addEventHandler ("onClientGUIChanged", GUIEditor.edit[1], function () if guiGetText (source) ~= "" then guiGridListClear (GUIEditor.gridlist[1]) triggerServerEvent ("searchForIt", localPlayer, guiGetText (source)) else triggerServerEvent ("getMapsBack", localPlayer) end end ) addEvent ("ReplyFromServer", true) addEventHandler ("ReplyFromServer", root, function (mapName, maps) for _,v in ipairs (maps) do if string.find (v:lower (), mapName:lower ()) then local row = guiGridListAddRow (GUIEditor.gridlist[1]) guiGridListSetItemText (GUIEditor.gridlist[1], row, 1, v, false, false) end end end ) addEvent ("getAllMaps", true) addEventHandler ("getAllMaps", root, function (maps) for _,v in ipairs (maps) do local row = guiGridListAddRow (GUIEditor.gridlist[1]) guiGridListSetItemText (GUIEditor.gridlist[1], row, 1, v, false, false) end end ) function fetchMaps ( ) local Maps_ = { } for k, v in ipairs( getResources ( ) ) do if ( getResourceInfo( v, "type" ) == "map" and getResourceInfo( v, "gamemodes" ) == "race" )then table.insert ( Maps_, getResourceInfo( v, "name" ) ) end end return Maps_ end addEvent ("GetMaps", true) addEventHandler ("GetMaps", root, function () local Maps = fetchMaps () triggerClientEvent (source, "addMaps_", source, Maps) end ) addEvent ("searchForIt", true) addEventHandler ("searchForIt", root, function (mapName) local maps = fetchMaps () triggerClientEvent (source, "ReplyFromServer", source, mapName, maps) end ) addEvent ("getMapsBack", true) addEventHandler ("getMapsBack", root, function () local maps = fetchMaps () triggerClientEvent (source, "getAllMaps", source, maps) end ) addEvent ("nextM", true) addEventHandler ("nextM", root, function (map) executeCommandHandler ("nextmap", source, map) end ) Link to comment
The Killer Posted August 21, 2015 Share Posted August 21, 2015 عجيب ؟ انا يبحث عندي تمام ومافيه مشاكل ! نفس الخطأ يطلع لك ؟ Link to comment
N3xT Posted August 21, 2015 Author Share Posted August 21, 2015 يب نفس الخطأ واذا رجعته getResourceName يبحث Link to comment
The Killer Posted August 21, 2015 Share Posted August 21, 2015 وين تعدله انت ؟ في fetchMaps ? Link to comment
N3xT Posted August 21, 2015 Author Share Posted August 21, 2015 function fetchMaps ( ) local Maps_ = { } for k, v in ipairs( getResources ( ) ) do if ( getResourceInfo( v, "type" ) == "map" and getResourceInfo( v, "gamemodes" ) == "race" )then table.insert ( Maps_, getResourceName (v) ) end end return Maps_ end يب هنا Link to comment
The Killer Posted August 21, 2015 Share Posted August 21, 2015 طيب تقدر تطرح اكوادك كامله مع اللوحه وهذي ؟ لأن انا عندي يبحث لو غيرتها ولا ما غيرتها ونفس الاكواد Link to comment
N3xT Posted August 21, 2015 Author Share Posted August 21, 2015 طيب تقدر تطرح اكوادك كامله مع اللوحه وهذي ؟لأن انا عندي يبحث لو غيرتها ولا ما غيرتها ونفس الاكواد برسلها لك ع الخاص Link to comment
N3xT Posted August 21, 2015 Author Share Posted August 21, 2015 * يغلق تمت الإفادة . شكراً : لكل من ساعدني Link to comment
</Mr.Tn6eL> Posted August 21, 2015 Share Posted August 21, 2015 * يغلق تمت الإفادة .شكراً : لكل من ساعدني العفو ... وش كان الغلط Link to comment
N3xT Posted August 21, 2015 Author Share Posted August 21, 2015 * يغلق تمت الإفادة .شكراً : لكل من ساعدني العفو ... وش كان الغلط طلعت كل الاكواد صح ، بس المشكلة من نفس السيرفر حقي مدري ليه ، جربت ع سيرفر ثاني وظبط البحث 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