xX|KeMo|Xx Posted September 16, 2014 Share Posted September 16, 2014 كـل واحد وطريقته في خطأ عندكـ if not ( kemo ) or ( type ( kemo ) ~= "boolean" ) or not ( wind ) or not ( isElement ( wind ) ) then return false end يصير if not ( kemo ) or ( type ( kemo ) ~= "boolean" ) and not ( wind ) or not ( isElement ( wind ) ) then return false end بدال or and عشان لازم يصير التحقق ع الاثنين كذا انت خيرتهـ بين واحد من الاثنين اذا مثلا الـ kemo موجود رح يكمل حتى لو الـ wind مو موجود Link to comment
AboShanab Posted September 16, 2014 Share Posted September 16, 2014 جرب الكود وتكلم + في غلط عندك في كودك اللي فوق if alpa == 0 then ?? if alpha == 0 then ^ + الارقمنت اللي في كود setTimer اللي هو true م منه اي داعي + كودك مو مرتب Link to comment
xX|KeMo|Xx Posted September 16, 2014 Share Posted September 16, 2014 مـآ جربت كودي تبيني اجرب كودكـ المهم وـآثق انهـ مافيه خطأ + وتشكر ع التحذير لنه الحرف طار " يب الارقمنت ما لهـ داعي بس ما يأثر + انا مسويهـ 15 سطر عشان ارتبهـ بيصير مثل حقكـ فوق 30 سطر <> + ما قلت انه كودكـ ما يشتغل قلت كل الي عدلتهـ شلت الاور وخليتهـ انيد عشان يتحقق من الاثنين مع بعض عشان لا يصير شيء في الدي بق + شكـرآ ع التحذير Link to comment
AboShanab Posted September 16, 2014 Share Posted September 16, 2014 مـآ جربت كودي تبيني اجرب كودكـ المهم وـآثق انهـ مافيه خطأ + وتشكر ع التحذير لنه الحرف طار " يب الارقمنت ما لهـ داعي بس ما يأثر + انا مسويهـ 15 سطر عشان ارتبهـ بيصير مثل حقكـ فوق 30 سطر <> + ما قلت انه كودكـ ما يشتغل قلت كل الي عدلتهـ شلت الاور وخليتهـ انيد عشان يتحقق من الاثنين مع بعض عشان لا يصير شيء في الدي بق + شكـرآ ع التحذير ._. افهم معناها بعدين تكلم Link to comment
xX|KeMo|Xx Posted September 16, 2014 Share Posted September 16, 2014 افهم معنى شوآ :_? <> المهم عشان لا يتغير مسار الموضوع الكود شغال ومافيهـ مشاكل ولا بقـآت function guiSetVisiblex(wind,kemo) if not isElement(wind) then return end if kemo == true then if guiGetVisible(wind) ~= false then return end local alpha = 0 guiSetAlpha(wind,alpha) guiSetVisible(wind, true) setTimer(function() alpha = alpha + 0.1 guiSetAlpha(wind, alpha) end,50,10,true) elseif kemo == false then if guiGetVisible(wind) ~= true then return end local alpha = 1 guiSetAlpha(wind,alpha) setTimer(function() alpha = alpha - 0.1 guiSetAlpha(wind, alpha) if alpha == 0 then guiSetVisible(wind, false) end end,50,10) end end الاستخدام للـ gui فقط الفـآيده انه تشتغل القـآي وهي شفــآفهـ لـيوم ما تصير عاديهـ والعكس alpha <~ guiSetVisiblex(wind,true) --كذا تشغيل ومكان الويند تحط اسم الـقـآي الي تبيهـ يصير عليهـ الوضع guiSetVisiblex(wind,false) --كذا ايقاف ومكان الويند تحط اسم الـقـآي الي تبيهـ يصير عليهـ الوضع Link to comment
xX|KeMo|Xx Posted September 16, 2014 Share Posted September 16, 2014 function setTimeMode(kemo) if not tonumber(kemo) then return end if kemo == 0 then setTime(12, 0) setMinuteDuration(1000) elseif kemo == 1 then setMinuteDuration(100000000000000000) elseif kemo == 2 then setMinuteDuration(60000) setTime(getRealTime().hour, getRealTime().minute) end end الفايدهـ انهـ يسوي اوضـآع للـتـآيم حق العبه وضع رقم 0 الوضع الطبيعي وضع رقم 1 يجمد التايم ما يتحركـ وضع رقم 2 يخلي وقت العبهـ مثل الوقت الحقيقي الفنكش يصلح كلنت وسيرفر مثال على طريقه الاستخدام --serverside addCommandHandler("testTime", function (_,_,num) setTimeMode(2) end) Link to comment
AboShanab Posted September 17, 2014 Share Posted September 17, 2014 ناقصك تتاكد انه عوض kemo Link to comment
</Mr.Tn6eL> Posted January 16, 2015 Share Posted January 16, 2015 getAgeFromShoeSize Client and Server Fucntion احظار العمر من مقاس الحذاء Syntax : int getAgeFromShoeSize(int ShoeSize, int CCY, int DOB) ShoeSize : Shoe Size || حجم الحذاء CCY : Current Calendar year || التاريخ الميلادي الحالي DOB : Date of birth 'Calendar year' || تاريخ الولادة بالميلادي Returns Returns Age if the arguments are valid, false otherwise اذا كانت الارقمنات خطأ false يرجع القيمة الى العمر اذا كانت الارقمنات صحيحة ويرجع القيمة Function Code : function getAgeFromShoeSize(ShoeSize, CCY, DOB) if not tonumber(ShoeSize) or not tonumber(CCY) or not tonumber(DOB) then return false end local AI = CCY - 1000 local Age = (((ShoeSize * 5) + 50) * 20 + AI) - DOB return tonumber(string.sub(tostring(Age), 3)) end Example : print(getAgeFromShoeSize(45, 2015, 1997)) Mta : Client Side addCommandHandler("GAFSS", function(_, ShoeSize, DOB) if not tonumber(ShoeSize) or not tonumber(DOB) then return outputChatBox("GAFSS: Syntax (Your Shoe Size, Date of birth)", 255, 155, 0) end outputChatBox(getAgeFromShoeSize(ShoeSize, 1900 + getRealTime( ).year , DOB)) end) Link to comment
ALw7sH Posted January 17, 2015 Share Posted January 17, 2015 getAgeFromShoeSize Client and Server Fucntion احظار العمر من مقاس الحذاء Syntax : int getAgeFromShoeSize(int ShoeSize, int CCY, int DOB) ShoeSize : Shoe Size || حجم الحذاء CCY : Current Calendar year || التاريخ الميلادي الحالي DOB : Date of birth 'Calendar year' || تاريخ الولادة بالميلادي Returns Returns Age if the arguments are valid, false otherwise اذا كانت الارقمنات خطأ false يرجع القيمة الى العمر اذا كانت الارقمنات صحيحة ويرجع القيمة Function Code : function getAgeFromShoeSize(ShoeSize, CCY, DOB) if not tonumber(ShoeSize) or not tonumber(CCY) or not tonumber(DOB) then return false end local AI = CCY - 1000 local Age = (((ShoeSize * 5) + 50) * 20 + AI) - DOB return tonumber(string.sub(tostring(Age), 3)) end Example : print(getAgeFromShoeSize(45, 2015, 1997)) Mta : Client Side addCommandHandler("GAFSS", function(_, ShoeSize, DOB) if not tonumber(ShoeSize) or not tonumber(DOB) then return outputChatBox("GAFSS: Syntax (Your Shoe Size, Date of birth)", 255, 155, 0) end outputChatBox(getAgeFromShoeSize(ShoeSize, 1900 + getRealTime( ).year , DOB)) end) Useful Arab functions Link to comment
</Mr.Tn6eL> Posted January 17, 2015 Share Posted January 17, 2015 getAgeFromShoeSize Client and Server Fucntion احظار العمر من مقاس الحذاء Syntax : int getAgeFromShoeSize(int ShoeSize, int CCY, int DOB) ShoeSize : Shoe Size || حجم الحذاء CCY : Current Calendar year || التاريخ الميلادي الحالي DOB : Date of birth 'Calendar year' || تاريخ الولادة بالميلادي Returns Returns Age if the arguments are valid, false otherwise اذا كانت الارقمنات خطأ false يرجع القيمة الى العمر اذا كانت الارقمنات صحيحة ويرجع القيمة Function Code : function getAgeFromShoeSize(ShoeSize, CCY, DOB) if not tonumber(ShoeSize) or not tonumber(CCY) or not tonumber(DOB) then return false end local AI = CCY - 1000 local Age = (((ShoeSize * 5) + 50) * 20 + AI) - DOB return tonumber(string.sub(tostring(Age), 3)) end Example : print(getAgeFromShoeSize(45, 2015, 1997)) Mta : Client Side addCommandHandler("GAFSS", function(_, ShoeSize, DOB) if not tonumber(ShoeSize) or not tonumber(DOB) then return outputChatBox("GAFSS: Syntax (Your Shoe Size, Date of birth)", 255, 155, 0) end outputChatBox(getAgeFromShoeSize(ShoeSize, 1900 + getRealTime( ).year , DOB)) end) Useful Arab functions يعني مو مفيد ؟ الا مفيد Link to comment
ALw7sH Posted January 17, 2015 Share Posted January 17, 2015 DOB : Date of birth 'Calendar year' || تاريخ الولادة بالميلادي ذا لحاله يكفي انه يجيب عمرك مايحتاج باقي الاشياء الي مالها داعي Link to comment
</Mr.Tn6eL> Posted January 17, 2015 Share Posted January 17, 2015 DOB : Date of birth 'Calendar year' || تاريخ الولادة بالميلاديذا لحاله يكفي انه يجيب عمرك مايحتاج باقي الاشياء الي مالها داعي تقدر تسوي كذا 2015 - 1997 = 18 بس انا الطريقة من مقاس الحذاء يعني مو عاجبك لا ترد عالعموم مانبي نغير مسار الموضوع Link to comment
' A F . Posted February 5, 2015 Share Posted February 5, 2015 * countPlayersInWater * Syntax int countPlayersInWater( player thePlayer ) * Code function countPlayersInWater(Water) local count = 0 if Water and getElementType(Water) == "player" then for i,player in ipairs(getElementsByType("player")) do if isPlayerInWater(player,Water) then count = count + 1 end end end return count end * Example function getPlayersWater(player) local pl = countPlayersInWater(player) outputChatBox("Players in Water [ "..pl.." ] !",player) end addCommandHandler("getPlayerInWater",getPlayersWater) صرأإحة م عرفة اضيفها بـ الويكي الي يعرف بالله يضيفها See You Link to comment
TAPL Posted February 5, 2015 Share Posted February 5, 2015 ^ 1- 2- الفنكشن يتطلب ارقمنت واحد و الهدف منه يجيب مجموع اللاعبين الي في البحر ايش علاقة ذي الأشياء؟ Link to comment
</Mr.Tn6eL> Posted February 5, 2015 Share Posted February 5, 2015 function countPlayersInWater( ) local count = 0 for i,player in ipairs(getElementsByType("player")) do if isElementInWater(player) then count = count + 1 end end return count end function getPlayersInWater( ) local table = { } for i,player in ipairs(getElementsByType("player")) do if isElementInWater(player) then table.insert(table, player) end end return table end Link to comment
EH10 Posted February 5, 2015 Share Posted February 5, 2015 (edited) countPlayersInRange Function : تـجلب عدد الاعبين الذين قريبين من مكان محدد * [ Function Syntax ] ., int countPlayersInRange(float x, float y, float z, float range) * [ Code ] ., function countPlayersInRange(x, y, z, range) if tonumber(x..y..z..range) then local add = 0 for _, v in ipairs(getElementsByType("player")) do local px, py, pz = getElementPosition( v ) if getDistanceBetweenPoints3D(px, py, pz, tonumber(x), tonumber(y), tonumber(z)) <= tonumber(range) then add = add + 1 end end return add else return false end end ُExample [ مـثال ] . addCommandHandler('EH10', function (player) local number = countPlayersInRange(x, y, z, range) outputChatBox("Number : " .. number .. " .", player, 255, 0, 0, true) end ) { ( صـفـحة الويكي [ https://wiki.multitheftauto.com/wiki/Co ... ersInRange ] ) } ., Edited February 13, 2015 by Guest Link to comment
Rm-Dj Posted March 27, 2015 Share Posted March 27, 2015 اخوي ^ اعتقد هاذي غلط if tonumber(x..y..z..range) then مو المفروض تكون كذا ؟ if tonumber(x) and tonumber(y) and tonumber(z) and tonumber(range) then Link to comment
ALw7sH Posted March 27, 2015 Share Posted March 27, 2015 ^ type المفروض يستخدم فنكشن if type(z) == "number" then print("z is number!") end Link to comment
TAPL Posted March 27, 2015 Share Posted March 27, 2015 ^ ماهي غلط + انا الي مسويها له Link to comment
EH10 Posted March 27, 2015 Share Posted March 27, 2015 (edited) ^ ماهي غلط + انا الي مسويها له حركة جديدة # Edited October 28, 2015 by Guest Link to comment
</Mr.Tn6eL> Posted April 22, 2015 Share Posted April 22, 2015 dxDrawTriangle وظيفة صنع مثلث function dxDrawTriangle(x, y, color, postGUI) for k=1,360 do local tx = 100 * math.sin(math.deg(k * math.pi / 90)) local ty = 100 * math.sin(math.atan(k * 3)) dxDrawLine(x, y, x + tx, y + ty, color, 1, postGUI) end end Example addEventHandler("onClientRender", root, function( ) dxDrawTriangle(400, 200, tocolor(255, 255, 255), false) end) جلست على الوظيفة 4 ساعات هههه الين ماضبط Link to comment
' A F . Posted April 23, 2015 Share Posted April 23, 2015 dxDrawTriangle وظيفة صنع مثلث function dxDrawTriangle(x, y, color, postGUI) for k=1,360 do local tx = 100 * math.sin(math.deg(k * math.pi / 90)) local ty = 100 * math.sin(math.atan(k * 3)) dxDrawLine(x, y, x + tx, y + ty, color, 1, postGUI) end end Example addEventHandler("onClientRender", root, function( ) dxDrawTriangle(400, 200, tocolor(255, 255, 255), false) end) جلست على الوظيفة 4 ساعات هههه الين ماضبط ^ وظيفة حلوهه ب التوفيق <3 Link to comment
*[MSN]MHMD Posted April 28, 2015 Share Posted April 28, 2015 These useful client side functions make a GridList have a players names Syntax element guiCreateGridListPlayers ( element gridListName, element columnName, element rowName, float x, float y, float width, float height, bool relative, float columnWidth, [ element parent = nil ] ) Required Arguments gridListName: This element is name for GUI gridlist. This name help you to control in GUI GridList for other function. columnName: This element is name for GUI GridList Column. This name help you to control in GUI GridList Column for other function. rowName: This element is name for GUI GridList Row. This name help you to control in GUI GridList Row for other function. x: A float of the 2D x position of the GUI gridlist on a player's screen. This is affected by the ''relative'' argument. y: A float of the 2D y position of the GUI gridlist on a player's screen. This is affected by the ''relative'' argument. width: A float of the width of the GUI gridlist. This is affected by the ''relative'' argument. height: A float of the height of the GUI gridlist. This is affected by the ''relative'' argument. relative: This is whether sizes and positioning are relative. If this is ''true'', then all x,y,width,height floats must be between 0 and 1, representing sizes relative to the parent. columnWidth: A float of the column width, relative to the grid list width. Optional Arguments parent: This is the parent that the gui gridlist is attached to. If the ''relative'' argument is true, sizes and positioning will be made relative to this parent. If the ''relative'' argument is false, positioning will be the number of offset pixels from the parent's origin. If no parent is passed, the parent will become the screen - causing positioning and sizing according to screen positioning. Returns Returns an element of the created GridList if it was successfully created, false otherwise. Function source ----- Client Side function guiCreateGridListPlayers( gridListName, columnName, rowName, x, y, width, height, relative, columnSize, parent ) if (type(gridListName) ~= "number") and (type(columnName) ~= "number") and (type(rowName) ~= "number") and (type(x) == "number") and (type(y == "number")) and (type(width == "number")) and (type(height == "number")) and (type(relative) == "boolean" ) and (type(columnSize == "number")) then if (type(parent) ~= "number") then gridListName = guiCreateGridList ( x, y, width, height, relative, parent ) playersColumnName = guiGridListAddColumn(gridListName, "Players", columnSize) local players = getElementsByType("player") for k,v in ipairs(players) do local rowName = guiGridListAddRow(gridListName) local PlayersName = getPlayerName(v) guiGridListSetItemText(gridListName,rowName,playersColumnName, PlayersName, false, false) end else gridListName = guiCreateGridList ( x, y, width, height, relative ) playersColumnName = guiGridListAddColumn(gridListName, "Players", columnSize) local players = getElementsByType("player") for k,v in ipairs(players) do local rowName = guiGridListAddRow(gridListName) local PlayersName = getPlayerName(v) guiGridListSetItemText(gridListName,rowName,playersColumnName, PlayersName, false, false) end end else return end end Author: [MSN]MHMD Example 1 ----- Client Side ----- This example create a players GridList. addEventHandler("onClientResourceStart",resourceRoot, function () local ScreenWidth,ScreenHeight = guiGetScreenSize() guiCreateGridListPlayers( TestGrid, TestColumon, TestRow, 300, 200, ScreenWidth/4, ScreenHeight/4 , false, 0.9 ) end ) Example 2 ----- Client Side ----- This example create a players GridList in GUI Window. addEventHandler("onClientResourceStart",resourceRoot, function () local ScreenWidth,ScreenHeight = guiGetScreenSize() TestWindow = guiCreateWindow( 200, 100, ScreenWidth/2, ScreenHeight/2, "Test", false ) guiCreateGridListPlayers( TestGrid, TestColumon, TestRow, 100, 80, ScreenWidth/4, ScreenHeight/4 , false, 0.9, TestWindow ) end ) + م عرفت اضيفه للويكي ,, الي معه شرح شي يجيبه Link to comment
ALw7sH Posted April 28, 2015 Share Posted April 28, 2015 These useful client side functions make a GridList have a players namesSyntax element guiCreateGridListPlayers ( element gridListName, element columnName, element rowName, float x, float y, float width, float height, bool relative, float columnWidth, [ element parent = nil ] ) Required Arguments gridListName: This element is name for GUI gridlist. This name help you to control in GUI GridList for other function. columnName: This element is name for GUI GridList Column. This name help you to control in GUI GridList Column for other function. rowName: This element is name for GUI GridList Row. This name help you to control in GUI GridList Row for other function. x: A float of the 2D x position of the GUI gridlist on a player's screen. This is affected by the ''relative'' argument. y: A float of the 2D y position of the GUI gridlist on a player's screen. This is affected by the ''relative'' argument. width: A float of the width of the GUI gridlist. This is affected by the ''relative'' argument. height: A float of the height of the GUI gridlist. This is affected by the ''relative'' argument. relative: This is whether sizes and positioning are relative. If this is ''true'', then all x,y,width,height floats must be between 0 and 1, representing sizes relative to the parent. columnWidth: A float of the column width, relative to the grid list width. Optional Arguments parent: This is the parent that the gui gridlist is attached to. If the ''relative'' argument is true, sizes and positioning will be made relative to this parent. If the ''relative'' argument is false, positioning will be the number of offset pixels from the parent's origin. If no parent is passed, the parent will become the screen - causing positioning and sizing according to screen positioning. Returns Returns an element of the created GridList if it was successfully created, false otherwise. Function source ----- Client Side function guiCreateGridListPlayers( gridListName, columnName, rowName, x, y, width, height, relative, columnSize, parent ) if (type(gridListName) ~= "number") and (type(columnName) ~= "number") and (type(rowName) ~= "number") and (type(x) == "number") and (type(y == "number")) and (type(width == "number")) and (type(height == "number")) and (type(relative) == "boolean" ) and (type(columnSize == "number")) then if (type(parent) ~= "number") then gridListName = guiCreateGridList ( x, y, width, height, relative, parent ) playersColumnName = guiGridListAddColumn(gridListName, "Players", columnSize) local players = getElementsByType("player") for k,v in ipairs(players) do local rowName = guiGridListAddRow(gridListName) local PlayersName = getPlayerName(v) guiGridListSetItemText(gridListName,rowName,playersColumnName, PlayersName, false, false) end else gridListName = guiCreateGridList ( x, y, width, height, relative ) playersColumnName = guiGridListAddColumn(gridListName, "Players", columnSize) local players = getElementsByType("player") for k,v in ipairs(players) do local rowName = guiGridListAddRow(gridListName) local PlayersName = getPlayerName(v) guiGridListSetItemText(gridListName,rowName,playersColumnName, PlayersName, false, false) end end else return end end Author: [MSN]MHMD Example 1 ----- Client Side ----- This example create a players GridList. addEventHandler("onClientResourceStart",resourceRoot, function () local ScreenWidth,ScreenHeight = guiGetScreenSize() guiCreateGridListPlayers( TestGrid, TestColumon, TestRow, 300, 200, ScreenWidth/4, ScreenHeight/4 , false, 0.9 ) end ) Example 2 ----- Client Side ----- This example create a players GridList in GUI Window. addEventHandler("onClientResourceStart",resourceRoot, function () local ScreenWidth,ScreenHeight = guiGetScreenSize() TestWindow = guiCreateWindow( 200, 100, ScreenWidth/2, ScreenHeight/2, "Test", false ) guiCreateGridListPlayers( TestGrid, TestColumon, TestRow, 100, 80, ScreenWidth/4, ScreenHeight/4 , false, 0.9, TestWindow ) end ) + م عرفت اضيفه للويكي ,, الي معه شرح شي يجيبه viewtopic.php?f=160&t=50111&p=539445&hilit=Gridlist#p539445 Link to comment
Simple. Posted April 29, 2015 Share Posted April 29, 2015 These useful client side functions make a GridList have a players namesSyntax element guiCreateGridListPlayers ( element gridListName, element columnName, element rowName, float x, float y, float width, float height, bool relative, float columnWidth, [ element parent = nil ] ) Required Arguments gridListName: This element is name for GUI gridlist. This name help you to control in GUI GridList for other function. columnName: This element is name for GUI GridList Column. This name help you to control in GUI GridList Column for other function. rowName: This element is name for GUI GridList Row. This name help you to control in GUI GridList Row for other function. x: A float of the 2D x position of the GUI gridlist on a player's screen. This is affected by the ''relative'' argument. y: A float of the 2D y position of the GUI gridlist on a player's screen. This is affected by the ''relative'' argument. width: A float of the width of the GUI gridlist. This is affected by the ''relative'' argument. height: A float of the height of the GUI gridlist. This is affected by the ''relative'' argument. relative: This is whether sizes and positioning are relative. If this is ''true'', then all x,y,width,height floats must be between 0 and 1, representing sizes relative to the parent. columnWidth: A float of the column width, relative to the grid list width. Optional Arguments parent: This is the parent that the gui gridlist is attached to. If the ''relative'' argument is true, sizes and positioning will be made relative to this parent. If the ''relative'' argument is false, positioning will be the number of offset pixels from the parent's origin. If no parent is passed, the parent will become the screen - causing positioning and sizing according to screen positioning. Returns Returns an element of the created GridList if it was successfully created, false otherwise. Function source ----- Client Side function guiCreateGridListPlayers( gridListName, columnName, rowName, x, y, width, height, relative, columnSize, parent ) if (type(gridListName) ~= "number") and (type(columnName) ~= "number") and (type(rowName) ~= "number") and (type(x) == "number") and (type(y == "number")) and (type(width == "number")) and (type(height == "number")) and (type(relative) == "boolean" ) and (type(columnSize == "number")) then if (type(parent) ~= "number") then gridListName = guiCreateGridList ( x, y, width, height, relative, parent ) playersColumnName = guiGridListAddColumn(gridListName, "Players", columnSize) local players = getElementsByType("player") for k,v in ipairs(players) do local rowName = guiGridListAddRow(gridListName) local PlayersName = getPlayerName(v) guiGridListSetItemText(gridListName,rowName,playersColumnName, PlayersName, false, false) end else gridListName = guiCreateGridList ( x, y, width, height, relative ) playersColumnName = guiGridListAddColumn(gridListName, "Players", columnSize) local players = getElementsByType("player") for k,v in ipairs(players) do local rowName = guiGridListAddRow(gridListName) local PlayersName = getPlayerName(v) guiGridListSetItemText(gridListName,rowName,playersColumnName, PlayersName, false, false) end end else return end end Author: [MSN]MHMD Example 1 ----- Client Side ----- This example create a players GridList. addEventHandler("onClientResourceStart",resourceRoot, function () local ScreenWidth,ScreenHeight = guiGetScreenSize() guiCreateGridListPlayers( TestGrid, TestColumon, TestRow, 300, 200, ScreenWidth/4, ScreenHeight/4 , false, 0.9 ) end ) Example 2 ----- Client Side ----- This example create a players GridList in GUI Window. addEventHandler("onClientResourceStart",resourceRoot, function () local ScreenWidth,ScreenHeight = guiGetScreenSize() TestWindow = guiCreateWindow( 200, 100, ScreenWidth/2, ScreenHeight/2, "Test", false ) guiCreateGridListPlayers( TestGrid, TestColumon, TestRow, 100, 80, ScreenWidth/4, ScreenHeight/4 , false, 0.9, TestWindow ) end ) + م عرفت اضيفه للويكي ,, الي معه شرح شي يجيبه اول شيء هذآ قسم عربي , مادري ليه حاط شرحك بالآنقليزي وثآني شيء وظيفة تغيير قيَم القريد لست إلى أسماء اللاعبين .. changeGridListItemToPlayersName = function ( GridList, Column ) if GridList and Column then -- Check Parematers if getElementType ( GridList ) == "gui-gridlist" then -- Check The Type of ' GridList ' if guiGridListClear ( GridList ) then -- Clear GridList for i, v in next, getElementsByType ( "player" ) do -- Get Everything by Type ' player ' local Row = guiGridListAddRow ( GridList ) -- Add Row guiGridListSetItemText ( GridList, Row, Column, getPlayerName ( v ), false, false ); -- Set New Values end; -- end of ' for ' end; -- end of ' clear gridlist ' end; -- end of ' check gridlist type ' end; -- end of ' check parematers end; -- end of ' function ' مثآل : wnd = guiCreateWindow ( 100, 100, 400, 400, "Test", false ); -- Create Window grid = guiCreateGridList ( 25, 30, 350, 350, false, wnd ); -- Create Gridlist col = guiGridListAddColumn ( grid, "Players", 0.9 ); -- Create Column changeGridListItemToPlayersName ( grid, col ); -- Set Gridlist Values آسهل ! 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