Kara Posted January 3, 2017 Share Posted January 3, 2017 8 hours ago, Master_MTA said: اخوي معليش الان وش الغلط @N3xT setTimer(function() for k,v in ipairs(getElementsByType('player'))do local g1 = getElementData(v,"pointplayer") taple={gi} if getElementData(v,"pointplayer") then if getPlayerTeam(v)then if table.sort(taple)==1 then setElementData(v,"bestplr",getPlayerName(v)) end end end end end,250,0) كودك كله كله غلط Link to comment
Master_MTA Posted January 4, 2017 Author Share Posted January 4, 2017 (edited) 9 hours ago, Kara said: كودك كله كله غلط okay can you correct it pls i cannot write Arabic because it's not my own Computer Edited January 4, 2017 by Master_MTA Link to comment
Master_MTA Posted January 4, 2017 Author Share Posted January 4, 2017 2 hours ago, Master_MTA said: okay can you correct it pls i cannot write Arabic because it's not my own Computer لو سمحت اخوي تقدر تعدلها ام لا @Kara Link to comment
MR.Mosa Posted January 4, 2017 Share Posted January 4, 2017 (edited) setTimer(function() for k,v in ipairs(getElementsByType('player'))do local g1 = getElementData(v,"pointplayer") taple={g1} if getElementData(v,"pointplayer") then if getPlayerTeam(v)then if table.sort(taple)==1 then setElementData(v,"bestplr",getPlayerName(v)) end end end end end,250,0) جرب كذا @Kara اتوقع الغلط عندك في ذا انت كاتبه كذا taple={gi} بدل taple={g1} Edited January 4, 2017 by MR.Mosa Link to comment
</Mr.Tn6eL> Posted January 4, 2017 Share Posted January 4, 2017 local bestplayer = table.sort(getElementsByType("player"), function(a, b) return getElementData(a, "pointplayer") > getElementData(b, "pointplayer") end)[1] 1 Link to comment
Master_MTA Posted January 4, 2017 Author Share Posted January 4, 2017 (edited) 2 hours ago, said: local bestplayer = table.sort(getElementsByType("player"), function(a, b) return getElementData(a, "pointplayer") > getElementData(b, "pointplayer") end)[1] فشل ادخال a لانه nil value @</Mr.Tn6eL> Edited January 4, 2017 by Master_MTA Link to comment
</Mr.Tn6eL> Posted January 4, 2017 Share Posted January 4, 2017 جرب عيد اضافة الاعبين في جدول Link to comment
Master_MTA Posted January 4, 2017 Author Share Posted January 4, 2017 (edited) 5 minutes ago, said: جرب عيد اضافة الاعبين في جدول ما فهمت عليك جربت اكثر من مره كذا صحيح؟ setTimer(function() local bestplayer = table.sort(getElementsByType("player"), function(a, b) return (getElementData(a, "pointplayer")or 0) > (getElementData(b, "pointplayer")or 0) end)[1] for k,v in ipairs(getElementsByType('player'))do if getElementData(v,"pointplayer") == bestplayer then setElementData(resourceRoot,"bestplr",getPlayerName(v)) end end end,250,0) @</Mr.Tn6eL> Edited January 4, 2017 by Master_MTA Link to comment
iMr ~ MnHmAr Posted January 4, 2017 Share Posted January 4, 2017 (edited) table.sort ( v, function ( a,b ) return tostring ( a.getElementData(v,"pointplayer") ) > tostring ( b.getElementData(v,"pointplayer") ) end ) جرب Edited January 4, 2017 by iMr ~ MnHmAr Link to comment
Master_MTA Posted January 4, 2017 Author Share Posted January 4, 2017 ما اشتغل ذذ @ iMr ~ MnHmAr Link to comment
N3xT Posted January 4, 2017 Share Posted January 4, 2017 setTimer(function() local bestplayer = table.sort(getElementsByType("player"), function(a, b) return (getElementData(a, "النقاط")or 0) > (getElementData(b, "النقاط")or 0) end)[1] setElementData(resourceRoot,"bestPlayer",bestplayer) end,250,0) عدل كلمة النقاط إلى الداتا حق نقاط اللاعب وعشان تجيب أفضل لاعب جيب الداتا bestPlayer Link to comment
Master_MTA Posted January 4, 2017 Author Share Posted January 4, 2017 36 minutes ago, N3xT said: setTimer(function() local bestplayer = table.sort(getElementsByType("player"), function(a, b) return (getElementData(a, "النقاط")or 0) > (getElementData(b, "النقاط")or 0) end)[1] setElementData(resourceRoot,"bestPlayer",bestplayer) end,250,0) عدل كلمة النقاط إلى الداتا حق نقاط اللاعب وعشان تجيب أفضل لاعب جيب الداتا bestPlayer ما زبط نفس الشي Link to comment
iPrestege Posted January 4, 2017 Share Posted January 4, 2017 @Master_MTA جرب هذا وعدل اسم داتا القتل او النقاط باول شيء : aKillsData = 'داتا النقاط' function aUpdateKiller ( ) aTopKiller = { }; for _,v in ipairs( getElementsByType ( 'player') ) do if getElementData ( v,aKillsData ) then table.insert ( aTopKiller,{ ['aName'] = getPlayerName ( v ),['aScore'] = getElementData ( v,aKillsData ) } ); end; end; table.sort ( aTopKiller, function ( a,b ) return a.aScore > b.aScore end ); end; aUpdateKiller ( ); addEventHandler ( 'onClientElementDataChange',root, function ( aD ) if aD == aKillsData then aUpdateKiller ( ); end end ); local aX,aY = guiGetScreenSize ( ) addEventHandler ( 'onClientRender',root, function ( ) if #aTopKiller > 0 then dxDrawText ( 'Top Player is : '..aTopKiller[1].aName..' and His score is : '..aTopKiller [1].aScore..'', 44, aY - 43, aX, aY, tocolor ( 255, 255, 255, 255 ), 1 ) end end ) 1 Link to comment
Master_MTA Posted January 4, 2017 Author Share Posted January 4, 2017 15 minutes ago, iPrestege said: @Master_MTA جرب هذا وعدل اسم داتا القتل او النقاط باول شيء : aKillsData = 'داتا النقاط' function aUpdateKiller ( ) aTopKiller = { }; for _,v in ipairs( getElementsByType ( 'player') ) do if getElementData ( v,aKillsData ) then table.insert ( aTopKiller,{ ['aName'] = getPlayerName ( v ),['aScore'] = getElementData ( v,aKillsData ) } ); end; end; table.sort ( aTopKiller, function ( a,b ) return a.aScore > b.aScore end ); end; aUpdateKiller ( ); addEventHandler ( 'onClientElementDataChange',root, function ( aD ) if aD == aKillsData then aUpdateKiller ( ); end end ); local aX,aY = guiGetScreenSize ( ) addEventHandler ( 'onClientRender',root, function ( ) if #aTopKiller > 0 then dxDrawText ( 'Top Player is : '..aTopKiller[1].aName..' and His score is : '..aTopKiller [1].aScore..'', 44, aY - 43, aX, aY, tocolor ( 255, 255, 255, 255 ), 1 ) end end ) لبى قلبك يحبي انت يعطيك الف عافيه زبطططط Link to comment
Master_MTA Posted January 5, 2017 Author Share Posted January 5, 2017 الله يحييك +اشكر الجميع Link to comment
Abu-Solo Posted January 5, 2017 Share Posted January 5, 2017 3 minutes ago, Master_MTA 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