coNolel Posted June 26, 2017 Share Posted June 26, 2017 سلام عليكم يا شباب اليوم كنت اجرب فنكشنات يعني العب فيها وطحت ف مشكل ما عرفت أحله الترايقر ما يوصل الكلينت سايد mapsTable = {} function GetAllMaps() local Resources = getResources() for i, v in ipairs(Resources) do local ResInfoType, ResInfoGameMode = getResourceInfo(v, "type"), getResourceInfo(v, "gamemodes") if ResInfoType == "map" and ResInfoGameMode == "race" then table.insert(mapsTable, v) triggerClientEvent ( "onClientGetMaps", getRootElement(), v ) end end end GetAllMaps() addEvent("onClientGetMaps", true) addEventHandler("onClientGetMaps", root, function(v) outputChatBox("done") GirdList = guiCreateGridList(500, 295, 293, 213, false) guiGridListAddColumn(GirdList, "MapColumn", 0.9) guiGridListAddRow(GirdList) guiGridListSetItemText(GirdList, 0, 1, "-", false, false) end ) showCursor(true) أتمنى الحل ي شباب Link to comment
Mhmd.z Posted June 26, 2017 Share Posted June 26, 2017 استخدم التايمر , لآنك مو حاط حدث او شي وعلى طول رح ينتقل للفنكشن ف ممكن يصير خربطه وحتى لو حطيت حدث اول ما المود يتشغل مارح يضبط ... setTimer(GetAllMaps, 50, 1) Link to comment
Abdul KariM Posted June 26, 2017 Share Posted June 26, 2017 8 minutes ago, Mhmd.z said: استخدم التايمر , لآنك مو حاط حدث او شي وعلى طول رح ينتقل للفنكشن ف ممكن يصير خربطه وحتى لو حطيت حدث اول ما المود يتشغل مارح يضبط ... setTimer(GetAllMaps, 50, 1) تركيب الفنكشن نفسه فيه غلط بعدين هو مستدعي الوظيفة بسطر 17 ماله فايدة التايمر Link to comment
iMr.WiFi..! Posted June 26, 2017 Share Posted June 26, 2017 2 hours ago, Abdul KariM said: اكوادك خبصه ما اشوف اي خبصة بالموضوع قلي وين تقصد بيها "الخبصة" , ولو تقدر تصلح الكود بيكون شيء أجمل ذ Link to comment
coNolel Posted June 26, 2017 Author Share Posted June 26, 2017 2 hours ago, Abdul KariM said: تركيب الفنكشن نفسه فيه غلط بعدين هو مستدعي الوظيفة بسطر 17 ماله فايدة التايمر mapsTable = {} function GetAllMaps() local Resources = getResources() for i, v in ipairs(Resources) do local ResInfoType, ResInfoGameMode = getResourceInfo(v, "type"), getResourceInfo(v, "gamemodes") if ResInfoType == "map" and ResInfoGameMode == "race" then table.insert(mapsTable, v) triggerClientEvent ( "onClientGetMaps", getRootElement(), getResourceInfo(v, "name") ) end end end addEvent("getMaps", true) addEventHandler("getMaps", root , function() GetAllMaps() end) سويت زر في الكلينت سايد يوم أظغط عليه يوسي ترايقر، تمام ; بعدها حطيت يوم يوصل الترايقر يطبق الفنكشن كل شي أشتغل الحين كيف اجيب المابات ف الجريد ليست ما قد أشتغلت فيها @@ addEvent("onClientGetMaps", true) addEventHandler("onClientGetMaps", root, function (qwe ) outputChatBox("done") GirdList = guiCreateGridList(500, 295, 293, 213, false) guiGridListAddColumn(GirdList, "MapColumn", 0.9) guiGridListAddRow(GirdList) guiGridListSetItemText(GirdList, 0, 1, qwe, false, false) end) Link to comment
iMr.WiFi..! Posted June 26, 2017 Share Posted June 26, 2017 GirdList = guiCreateGridList(500, 295, 293, 213, false) guiGridListAddColumn(GirdList, "MapColumn", 0.9) addEvent("onClientGetMaps", true) addEventHandler("onClientGetMaps", root, function ( qwe ) local row = guiGridListAddRow(GirdList) guiGridListSetItemText(GirdList, row, 1, tostring(qwe), false, false) end) Link to comment
coNolel Posted June 26, 2017 Author Share Posted June 26, 2017 8 minutes ago, iMr.WiFi..! said: GirdList = guiCreateGridList(500, 295, 293, 213, false) guiGridListAddColumn(GirdList, "MapColumn", 0.9) addEvent("onClientGetMaps", true) addEventHandler("onClientGetMaps", root, function ( qwe ) local row = guiGridListAddRow(GirdList) guiGridListSetItemText(GirdList, row, 1, tostring(qwe), false, false) end) ما زبط ، شف وش سويت انا سويت الترايقر على الجدول عشان اسوي اللوب mapsTable = {} function GetAllMaps() local Resources = getResources() for i, v in ipairs(Resources) do local ResInfoType, ResInfoGameMode = getResourceInfo(v, "type"), getResourceInfo(v, "gamemodes") if ResInfoType == "map" and ResInfoGameMode == "race" then table.insert(mapsTable, v) triggerClientEvent ( "onClientGetMaps", getRootElement(), mapsTable ) end end end ورحت للكلينت سويت كذا بس م زبط معي ض addEvent("onClientGetMaps", true) addEventHandler("onClientGetMaps", root, function (mapTables ) outputChatBox("done") GirdList = guiCreateGridList(500, 295, 293, 213, false) kheColumn = guiGridListAddColumn(GirdList, "MapColumn", 0.9) for i , v in ipairs(mapTables) do kheRow = guiGridListAddRow(GirdList) guiGridListSetItemText(GirdList, kheRow, kheColumn, v, false, false) end end) @iMr.WiFi..! Link to comment
iMr.WiFi..! Posted June 26, 2017 Share Posted June 26, 2017 (edited) غير سطر 9 الى : table.insert(mapsTable, getResourceInfo(v,"name")) ونزل كود انشاء الجريدليست/كولمن خارج الحدث Edited June 26, 2017 by iMr.WiFi..! Link to comment
coNolel Posted June 26, 2017 Author Share Posted June 26, 2017 3 minutes ago, iMr.WiFi..! said: Change line 9 to : table.insert(mapsTable, getResourceInfo(v,"name")) خربت كل شي ض2 حتى التراقير الاول ما يوصل الحين Link to comment
iMr.WiFi..! Posted June 26, 2017 Share Posted June 26, 2017 1 minute ago, coNolel said: خربت كل شي ض2 حتى التراقير الاول ما يوصل الحين 4 minutes ago, iMr.WiFi..! said: غير سطر 9 الى : table.insert(mapsTable, getResourceInfo(v,"name")) ونزل كود انشاء الجريدليست/كولمن خارج الحدث + سوي تحقق انه الاسم مايساوي فراغ او فاضي Link to comment
coNolel Posted June 26, 2017 Author Share Posted June 26, 2017 1 minute ago, iMr.WiFi..! said: + سوي تحقق انه الاسم مايساوي فراغ او فاضي Attempt to get length of the table mapsTable = {} function GetAllMaps() local Resources = getResources() for i, v in ipairs(Resources) do local ResInfoType, ResInfoGameMode = getResourceInfo(v, "type"), getResourceInfo(v, "gamemodes") if ResInfoType == "map" and ResInfoGameMode == "race" then table.insert(mapsTable, v) outputChatBox(#mapTables)-- here triggerClientEvent ( "onClientGetMaps", getRootElement(), mapsTable ) end end end Link to comment
iMr.WiFi..! Posted June 26, 2017 Share Posted June 26, 2017 Just now, coNolel said: Attempt to get length of the table mapsTable = {} function GetAllMaps() local Resources = getResources() for i, v in ipairs(Resources) do local ResInfoType, ResInfoGameMode = getResourceInfo(v, "type"), getResourceInfo(v, "gamemodes") if ResInfoType == "map" and ResInfoGameMode == "race" then table.insert(mapsTable, v) outputChatBox(#mapTables)-- here triggerClientEvent ( "onClientGetMaps", getRootElement(), mapsTable ) end end end حطه خارج اللوب + ضيف التحقق انه الاسم ما يساوي "" Link to comment
coNolel Posted June 26, 2017 Author Share Posted June 26, 2017 1 minute ago, iMr.WiFi..! said: حطه خارج اللوب + ضيف التحقق انه الاسم ما يساوي "" اتحقق داخل اللوب ، + كيف ؟ض Link to comment
iMr.WiFi..! Posted June 26, 2017 Share Posted June 26, 2017 (edited) mapsTable = {} function GetAllMaps() local Resources = getResources() for i, v in ipairs(Resources) do local ResInfoType, ResInfoGameMode, ResName = getResourceInfo(v, "type"), getResourceInfo(v, "gamemodes"), getResourceInfo ( v, "name" ) if ResInfoType == "map" and ResInfoGameMode == "race" and ResName ~= "" then table.insert(mapsTable, { Name = ResName, Resource = v }) triggerClientEvent ( "onClientGetMaps", getRootElement(), mapsTable ) end end outputChatBox(#mapTables) end GirdList = guiCreateGridList(500, 295, 293, 213, false) kheColumn = guiGridListAddColumn(GirdList, "MapColumn", 0.9) addEvent("onClientGetMaps", true) addEventHandler("onClientGetMaps", root, function ( mapTables ) guiGridListClear(GirdList); for i , v in ipairs(mapTables) do kheRow = guiGridListAddRow(GirdList) guiGridListSetItemText(GirdList, kheRow, kheColumn, v.Name, false, false) end end) Edited June 26, 2017 by iMr.WiFi..! Link to comment
coNolel Posted June 26, 2017 Author Share Posted June 26, 2017 2 minutes ago, iMr.WiFi..! said: mapsTable = {} function GetAllMaps() local Resources = getResources() for i, v in ipairs(Resources) do local ResInfoType, ResInfoGameMode, ResName = getResourceInfo(v, "type"), getResourceInfo(v, "gamemodes"), getResourceInfo ( v, "name" ) if ResInfoType == "map" and ResInfoGameMode == "race" and ResName ~= "" then table.insert(mapsTable, { Name = ResName, Resource = v }) triggerClientEvent ( "onClientGetMaps", getRootElement(), mapsTable ) end end outputChatBox(#mapTables) end GirdList = guiCreateGridList(500, 295, 293, 213, false) kheColumn = guiGridListAddColumn(GirdList, "MapColumn", 0.9) addEvent("onClientGetMaps", true) addEventHandler("onClientGetMaps", root, function ( mapTables ) for i , v in ipairs(mapTables) do kheRow = guiGridListAddRow(GirdList) guiGridListSetItemText(GirdList, kheRow, kheColumn, v.Name, false, false) end end) يجيب المابات متبدلة Link to comment
iMr.WiFi..! Posted June 26, 2017 Share Posted June 26, 2017 3 minutes ago, coNolel said: يجيب المابات متبدلة تم عدلته ذ Link to comment
coNolel Posted June 26, 2017 Author Share Posted June 26, 2017 4 minutes ago, iMr.WiFi..! said: تم عدلته ذ يعطيك العافية تمت الإفادة # Link to comment
iMr.WiFi..! Posted June 27, 2017 Share Posted June 27, 2017 10 hours ago, coNolel said: يعطيك العافية تمت الإفادة # الله يعافيك .. 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