#Soking Posted February 7, 2016 Share Posted February 7, 2016 سلام عليكم قررة اسوي توب لداتا معينه حقتي مثال مسوي مثلا اليقتل يصير هيك setElementData(source,'Kill',getElementData(source,'Kill') + 1 ) ملحوظه مثال فقط مشان تفهموني انا الحين مسوي 2 كولمن بالقريد ليست الاول الاسم و الثاني رقم الداتا الحين كيف اخلي يرتب الناس حسب اكبر واحد معه داتا ؟ Link to comment
Rockyz Posted February 8, 2016 Share Posted February 8, 2016 (edited) table getElementsByType -- loop the Players table.insert table.sort Edited February 8, 2016 by Guest Link to comment
#Soking Posted February 8, 2016 Author Share Posted February 8, 2016 ممكن امثله على سطر 4 . 5 Link to comment
3NAD Posted February 8, 2016 Share Posted February 8, 2016 TopList = { }; for i, v in ipairs ( getElementsByType ( "player" ) ) do local kill = getElementData ( v, "Kill" ) if kill then table.insert ( TopList, { Name= getPlayerName ( v ), Kills= kill } ) end end table.sort ( TopList, function( a, b ) return ( tonumber( a.Kills ) or 0 ) > ( tonumber( b.Kills ) or 0 ) end ) 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