اي هذا بالفري روم,
بس اتوقع انه مسويه إختصآر,
مثل يوم تسوي,
player = getLocalPlayer()
بس هو مسوي فنكشن,
شوف ملف util_server <
function table.each(t, index, callback, ...)
local args = { ... }
if type(index) == 'function' then
table.insert(args, 1, callback)
callback = index
index = false
end
local restart, oldlen
repeat
restart = false
oldlen = #t
for k,v in pairs(t) do
callback(index and v[index] or v, unpack(args))
if not t[k] or #t ~= oldlen then
restart = true
break
end
end
until not restart
return t
end
~ هذا هو الاختصار,
الي فهمته,من المثال انه يرتب لك الاشياء,
> t = { 3,2,5,1,4 }
> table.sort(t)
> = table.concat(t, ", ")
1, 2, 3, 4, 5
لاحظ فوق حاط ,
3,2,5,1,4
وطلع الناتج ,
1,2,3,4,5
table.sort = اتوقع تقدر تغير خصائص الجدول,
+ في مثال عليها ,
http://lua-users.org/wiki/TableLibraryTutorial
+ table.each = ما اشوف انها موجوده بويكي لوا
ما تجي لازم ارقومنت للشيء الي تبيه اسم اللاعب او...الخ
+ بالنسبه ل اذا ضغط جرب كذا
addEventHandler("onClientGUIClick",grid,
function()
gridListFunction()
end,false)
grid = اسم القريد ليست حقك
gridListFunction() = اسم الفنكشن حق القريد ليست
لازم تحطه نفسه يعني حتى لو كان كذا
MyGridList(player,row)
ما جربتها بس اتوقع تضبط
مثال آخر
addEventHandler("onClientResourceStart",resourceRoot,
function()
triggerServerEvent("spawn",localPlayer)
end)
-- Server
addEvent("spawn",true)
addEventHandler("spawn",root,
function()
for _,player in next(getElementsByType("player")) do
spawnPlayer(player,x,y,z)
end
end)
لا ما يكفي ماهي معرفه لازم تعرفها بالكلنت او لوب
+ مثال على nil
Timer = setTimer(
function()
-- Nothing
if (isTimer(Timer)) then
Timer = nil
end
end,1000,0)