☠ RaZeR ☠ Posted February 2, 2014 Share Posted February 2, 2014 (edited) هلا شباب ابي كود يحط كل الاعبين بالقريد ليست تلقائيا ولما واحد يخرج يطلع برا القريد ليست Edited February 2, 2014 by Guest Link to comment
TAPL Posted February 2, 2014 Share Posted February 2, 2014 اول شي لازم تحط كل اللاعبين في القريد لست موجود في مثال الويكي https://wiki.multitheftauto.com/wiki/GuiGridListSetItemText هذا لتحديث القائمة You can use this and be sure to replace gridList and column with your. function updateList(old, new) if eventName == "onClientPlayerJoin" then local row = guiGridListAddRow(gridList) guiGridListSetItemText(gridList, row, column, getPlayerName(source), false, false) elseif eventName == "onClientPlayerQuit" then for i=0, guiGridListGetRowCount(gridList) do if guiGridListGetItemText(gridList, i, column) == getPlayerName(source) then guiGridListRemoveRow(gridList, i) end end elseif eventName == "onClientPlayerChangeNick" then for i=0, guiGridListGetRowCount(gridList) do if guiGridListGetItemText(gridList, i, column) == old then guiGridListSetItemText(gridList, i, column, new, false, false) end end end end addEventHandler("onClientPlayerJoin", root, updateList) addEventHandler("onClientPlayerQuit", root, updateList) addEventHandler("onClientPlayerChangeNick", root, updateList) Link to comment
☠ RaZeR ☠ Posted February 2, 2014 Author Share Posted February 2, 2014 كيف احط الاعبين في القريد ليست ++++++++++++++++++++++++++++++++++++++++ احط ذا الكوود وين function updateList(old, new) if eventName == "onClientPlayerJoin" then local row = guiGridListAddRow(gridList) guiGridListSetItemText(gridList, row, column, getPlayerName(source), false, false) elseif eventName == "onClientPlayerQuit" then for i=0, guiGridListGetRowCount(gridList) do if guiGridListGetItemText(gridList, i, column) == getPlayerName(source) then guiGridListRemoveRow(gridList, i) end end elseif eventName == "onClientPlayerChangeNick" then for i=0, guiGridListGetRowCount(gridList) do if guiGridListGetItemText(gridList, i, column) == old then guiGridListSetItemText(gridList, i, column, new, false, false) end end end end addEventHandler("onClientPlayerJoin", root, updateList) addEventHandler("onClientPlayerQuit", root, updateList) addEventHandler("onClientPlayerChangeNick", root, updateList) في c.lua او s.lua Link to comment
TAPL Posted February 2, 2014 Share Posted February 2, 2014 ردي فوق واضح الكود الي يحط اللاعبين في القريد لست موجود في رابط الويكي الي انا حطيته و الكود حق تحديث القائمة بعد واضح كلهم كلينت Link to comment
Mr.T9 Posted February 2, 2014 Share Posted February 2, 2014 كيف احط الاعبين في القريد ليست++++++++++++++++++++++++++++++++++++++++ احط ذا الكوود وين function updateList(old, new) if eventName == "onClientPlayerJoin" then local row = guiGridListAddRow(gridList) guiGridListSetItemText(gridList, row, column, getPlayerName(source), false, false) elseif eventName == "onClientPlayerQuit" then for i=0, guiGridListGetRowCount(gridList) do if guiGridListGetItemText(gridList, i, column) == getPlayerName(source) then guiGridListRemoveRow(gridList, i) end end elseif eventName == "onClientPlayerChangeNick" then for i=0, guiGridListGetRowCount(gridList) do if guiGridListGetItemText(gridList, i, column) == old then guiGridListSetItemText(gridList, i, column, new, false, false) end end end end addEventHandler("onClientPlayerJoin", root, updateList) addEventHandler("onClientPlayerQuit", root, updateList) addEventHandler("onClientPlayerChangeNick", root, updateList) في c.lua او s.lua الاسم مو مهم حطه بملف الكلنت اللي بمودك Link to comment
-MF[7]6 Posted February 2, 2014 Share Posted February 2, 2014 " onClientPlayerJoin " = Client Link to comment
☠ RaZeR ☠ Posted February 2, 2014 Author Share Posted February 2, 2014 شباب انا حطيت ذا الكوود function clientsideResourceStart () local playerList = guiCreateGridList ( 0.80, 0.10, 0.15, 0.60, true ) -- Create the grid list local column = guiGridListAddColumn( playerList, "Player", 0.85 ) -- Create a 'players' column in the list if ( column ) then -- If the column was successfully created for id, playeritem in ipairs(getElementsByType("player")) do --Loop through all the players, adding them to the table local row = guiGridListAddRow ( playerList ) guiGridListSetItemText ( playerList, row, column, getPlayerName ( playeritem ), false, false ) end end end addEventHandler ( "onClientResourceStart", getResourceRootElement(), clientsideResourceStart function updateList(old, new) if eventName == "onClientPlayerJoin" then local row = guiGridListAddRow(gridList) guiGridListSetItemText(gridList, row, column, getPlayerName(source), false, false) elseif eventName == "onClientPlayerQuit" then for i=0, guiGridListGetRowCount(gridList) do if guiGridListGetItemText(gridList, i, column) == getPlayerName(source) then guiGridListRemoveRow(gridList, i) end end elseif eventName == "onClientPlayerChangeNick" then for i=0, guiGridListGetRowCount(gridList) do if guiGridListGetItemText(gridList, i, column) == old then guiGridListSetItemText(gridList, i, column, new, false, false) end end end end addEventHandler("onClientPlayerJoin", root, updateList) addEventHandler("onClientPlayerQuit", root, updateList) addEventHandler("onClientPlayerChangeNick", root, updateList) في c.lua و الكود ذا function clientsideResourceStart () local playerList = guiCreateGridList ( 0.80, 0.10, 0.15, 0.60, true ) -- Create the grid list local column = guiGridListAddColumn( playerList, "Player", 0.85 ) -- Create a 'players' column in the list if ( column ) then -- If the column was successfully created for id, playeritem in ipairs(getElementsByType("player")) do --Loop through all the players, adding them to the table local row = guiGridListAddRow ( playerList ) guiGridListSetItemText ( playerList, row, column, getPlayerName ( playeritem ), false, false ) end end end addEventHandler ( "onClientResourceStart", getResourceRootElement(), clientsideResourceStart ) في c.lua TAPL الكوود الثاني جايبه من https://wiki.multitheftauto.com/wiki/Gu ... etItemText الرابط الي انت ارسلته لي Link to comment
TAPL Posted February 2, 2014 Share Posted February 2, 2014 You can use this and be sure to replace gridList and column with your. استبدلهم بالمتغير الي عندك Link to comment
☠ RaZeR ☠ Posted February 2, 2014 Author Share Posted February 2, 2014 مشكورين ياشباب بالخصوص تابل 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