Jump to content

تحت التطوير :كود - Useful Arab functions


Booo

Recommended Posts

كـل واحد وطريقته

:arrowdown::arrowleft:

في خطأ عندكـ

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

مو موجود

:arrowup::arrowdown::arrowleft:

Link to comment

مـآ جربت كودي تبيني اجرب كودكـ xD

المهم وـآثق انهـ مافيه خطأ + وتشكر ع التحذير لنه الحرف طار " يب الارقمنت ما لهـ داعي بس ما يأثر

+ انا مسويهـ 15 سطر عشان ارتبهـ بيصير مثل حقكـ فوق 30 سطر <>

+ ما قلت انه كودكـ ما يشتغل قلت كل الي عدلتهـ شلت الاور وخليتهـ انيد عشان يتحقق من الاثنين مع بعض عشان لا يصير شيء في الدي بق

+ شكـرآ ع التحذير ;)

Link to comment
مـآ جربت كودي تبيني اجرب كودكـ xD

المهم وـآثق انهـ مافيه خطأ + وتشكر ع التحذير لنه الحرف طار " يب الارقمنت ما لهـ داعي بس ما يأثر

+ انا مسويهـ 15 سطر عشان ارتبهـ بيصير مثل حقكـ فوق 30 سطر <>

+ ما قلت انه كودكـ ما يشتغل قلت كل الي عدلتهـ شلت الاور وخليتهـ انيد عشان يتحقق من الاثنين مع بعض عشان لا يصير شيء في الدي بق

+ شكـرآ ع التحذير ;)

._.

افهم معناها بعدين تكلم :mrgreen:

Link to comment

افهم معنى شوآ :_?

<>

المهم عشان لا يتغير مسار الموضوع الكود شغال ومافيهـ مشاكل ولا بقـآت

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

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
  • 3 months later...

getAgeFromShoeSize

Client and Server Fucntion

احظار العمر من مقاس الحذاء

:lol:

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

getAgeFromShoeSize

Client and Server Fucntion

احظار العمر من مقاس الحذاء

:lol:

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

getAgeFromShoeSize

Client and Server Fucntion

احظار العمر من مقاس الحذاء

:lol:

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

يعني مو مفيد ؟ الا مفيد :mrgreen:

Link to comment
DOB : Date of birth 'Calendar year' || تاريخ الولادة بالميلادي

ذا لحاله يكفي انه يجيب عمرك مايحتاج باقي الاشياء الي مالها داعي

تقدر تسوي كذا

2015 - 1997 = 18

بس انا الطريقة من مقاس الحذاء

يعني مو عاجبك لا ترد

عالعموم مانبي نغير مسار الموضوع

Link to comment
  • 3 weeks later...

* 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) 

صرأإحة م عرفة اضيفها بـ الويكي الي يعرف بالله يضيفها :D:D

See You :$

Link to comment
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

countPlayersInRange

Function : تـجلب عدد الاعبين الذين قريبين من مكان محدد l9l00029.png

* [ 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 by Guest
Link to comment
  • 1 month later...
  • 4 weeks later...

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

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

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
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 
) 

+ م عرفت اضيفه للويكي ,, الي معه شرح شي يجيبه

viewtopic.php?f=160&t=50111&p=539445&hilit=Gridlist#p539445

Link to comment
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 
) 

+ م عرفت اضيفه للويكي ,, الي معه شرح شي يجيبه

اول شيء هذآ قسم عربي , مادري ليه حاط شرحك بالآنقليزي

وثآني شيء

وظيفة تغيير قيَم القريد لست إلى أسماء اللاعبين ..
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

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...