MR.StoRm Posted February 16, 2017 Share Posted February 16, 2017 السلام عليكم , كيف الحال يا شباب , ان شاء الله بخير, المهم, عندي مشكلة بمود توب التواجد وهي ما يظهر الساعات بجنب اللاعب في المود تضل 0:0:0, الكود : function guiCreateWindow( x2, y2, width2, height2, titleBarText2, relative2 ) local mainBackground = guiCreateStaticImage ( x2, y2, width2, height2, "wndow.png", relative2 ) local mainBackgroundLabel = guiCreateLabel ( 0, 0, 950, 300, titleBarText2, false, mainBackground ) guiSetEnabled ( mainBackgroundLabel, false ) return mainBackground end GUIEditor = { label = {} } local screenW, screenH = guiGetScreenSize() wnd = guiCreateStaticImage((screenW - 436) / 2, (screenH - 458) / 2, 436, 458, ":guieditors/images/wndow.png", false) guiSetVisible(wnd,false) Grid = guiCreateGridList(14, 54, 408, 355, false, wnd) guiGridListAddColumn(Grid, "x[ Player Name ]x", 0.5) guiGridListAddColumn(Grid, "x[ Time Player ]x", 0.5) GUIEditor.label[1] = guiCreateLabel(-5, -45, 418, 27, "", false, Grid) GUIEditor.label[2] = guiCreateLabel(7, 9, 419, 24, "=[ TOP 40 Onlines ]=", false, wnd) guiLabelSetColor(GUIEditor.label[2], 255, 0, 0) guiLabelSetHorizontalAlign(GUIEditor.label[2], "center", false) guiLabelSetVerticalAlign(GUIEditor.label[2], "center") Close = guiCreateButton(14, 409, 405, 33, "X", false, wnd) guiSetProperty(Close, "NormalTextColour", "FFFF1200") function getHours() playersTable = {} ; for i, v in ipairs(getElementsByType('player')) do local playerData = getElementData(v, "Time") or "0:0:0" local Hour, Min, Sec = unpack( split ( playerData, ":" ) ) table.insert(playersTable, {name = v, time = playerData}) end table.sort ( playersTable, function ( a, b ) return ( tostring ( a.time ) or "" ) > ( tostring ( b.time ) or "" ) end ) return playersTable end setTimer(function() --guiSetEnabled(Grid, false) guiSetVisible(Grid, false) guiSetVisible(Grid, true) guiGridListClear(Grid) local Hours = getHours() for one = 1, #getElementsByType('player') do if one >= 40 then return end local item = guiGridListAddRow(Grid) if (Hours[1]) then local itemName = guiGridListSetItemText(Grid, item, 1, one ..'-' .. getPlayerName(Hours[one].name), false, false) local itemName = guiGridListSetItemText(Grid, item, 2, Hours[one].time, false, false) guiGridListSetItemColor(Grid, item, 1, 255, 0, 0) guiGridListSetItemColor(Grid, item, 2, 0, 255, 0) end end end, 1000, 0) addEventHandler( 'onClientGUIClick', root, function() if source == Close then guiSetVisible(wnd, false) showCursor(false) end end ) function open() if guiGetVisible(wnd) == false then guiSetVisible(wnd, true) showCursor(true) else guiSetVisible(wnd, false) showCursor(false) end end bindKey( 'F10', 'down', open) Link to comment
Master_MTA Posted February 16, 2017 Share Posted February 16, 2017 45 minutes ago, MR.StoRm said: السلام عليكم , كيف الحال يا شباب , ان شاء الله بخير, المهم, عندي مشكلة بمود توب التواجد وهي ما يظهر الساعات بجنب اللاعب في المود تضل 0:0:0, الكود : function guiCreateWindow( x2, y2, width2, height2, titleBarText2, relative2 ) local mainBackground = guiCreateStaticImage ( x2, y2, width2, height2, "wndow.png", relative2 ) local mainBackgroundLabel = guiCreateLabel ( 0, 0, 950, 300, titleBarText2, false, mainBackground ) guiSetEnabled ( mainBackgroundLabel, false ) return mainBackground end GUIEditor = { label = {} } local screenW, screenH = guiGetScreenSize() wnd = guiCreateStaticImage((screenW - 436) / 2, (screenH - 458) / 2, 436, 458, ":guieditors/images/wndow.png", false) guiSetVisible(wnd,false) Grid = guiCreateGridList(14, 54, 408, 355, false, wnd) guiGridListAddColumn(Grid, "x[ Player Name ]x", 0.5) guiGridListAddColumn(Grid, "x[ Time Player ]x", 0.5) GUIEditor.label[1] = guiCreateLabel(-5, -45, 418, 27, "", false, Grid) GUIEditor.label[2] = guiCreateLabel(7, 9, 419, 24, "=[ TOP 40 Onlines ]=", false, wnd) guiLabelSetColor(GUIEditor.label[2], 255, 0, 0) guiLabelSetHorizontalAlign(GUIEditor.label[2], "center", false) guiLabelSetVerticalAlign(GUIEditor.label[2], "center") Close = guiCreateButton(14, 409, 405, 33, "X", false, wnd) guiSetProperty(Close, "NormalTextColour", "FFFF1200") function getHours() playersTable = {} ; for i, v in ipairs(getElementsByType('player')) do local playerData = getElementData(v, "Time") or "0:0:0" local Hour, Min, Sec = unpack( split ( playerData, ":" ) ) table.insert(playersTable, {name = v, time = playerData}) end table.sort ( playersTable, function ( a, b ) return ( tostring ( a.time ) or "" ) > ( tostring ( b.time ) or "" ) end ) return playersTable end setTimer(function() --guiSetEnabled(Grid, false) guiSetVisible(Grid, false) guiSetVisible(Grid, true) guiGridListClear(Grid) local Hours = getHours() for one = 1, #getElementsByType('player') do if one >= 40 then return end local item = guiGridListAddRow(Grid) if (Hours[1]) then local itemName = guiGridListSetItemText(Grid, item, 1, one ..'-' .. getPlayerName(Hours[one].name), false, false) local itemName = guiGridListSetItemText(Grid, item, 2, Hours[one].time, false, false) guiGridListSetItemColor(Grid, item, 1, 255, 0, 0) guiGridListSetItemColor(Grid, item, 2, 0, 255, 0) end end end, 1000, 0) addEventHandler( 'onClientGUIClick', root, function() if source == Close then guiSetVisible(wnd, false) showCursor(false) end end ) function open() if guiGetVisible(wnd) == false then guiSetVisible(wnd, true) showCursor(true) else guiSetVisible(wnd, false) showCursor(false) end end bindKey( 'F10', 'down', open) استخدم <> المره الجايه بالنسبه لطلبك تحقق من اسم الداتا حقة الساعات 2 Link to comment
MR.StoRm Posted February 16, 2017 Author Share Posted February 16, 2017 29 minutes ago, Master_MTA said: استخدم <> المره الجايه بالنسبه لطلبك تحقق من اسم الداتا حقة الساعات اعطيني الحل _) Link to comment
iMr.WiFi..! Posted February 16, 2017 Share Posted February 16, 2017 function guiCreateWindow( x2, y2, width2, height2, titleBarText2, relative2 ) local mainBackground = guiCreateStaticImage ( x2, y2, width2, height2, "wndow.png", relative2 ) local mainBackgroundLabel = guiCreateLabel ( 0, 0, 950, 300, titleBarText2, false, mainBackground ) guiSetEnabled ( mainBackgroundLabel, false ) return mainBackground end GUIEditor = { label = {} } local screenW, screenH = guiGetScreenSize() wnd = guiCreateStaticImage((screenW - 436) / 2, (screenH - 458) / 2, 436, 458, ":guieditors/images/wndow.png", false) guiSetVisible(wnd,false) Grid = guiCreateGridList(14, 54, 408, 355, false, wnd) guiGridListAddColumn(Grid, "x[ Player Name ]x", 0.5) guiGridListAddColumn(Grid, "x[ Time Player ]x", 0.5) GUIEditor.label[1] = guiCreateLabel(-5, -45, 418, 27, "", false, Grid) GUIEditor.label[2] = guiCreateLabel(7, 9, 419, 24, "=[ TOP 40 Onlines ]=", false, wnd) guiLabelSetColor(GUIEditor.label[2], 255, 0, 0) guiLabelSetHorizontalAlign(GUIEditor.label[2], "center", false) guiLabelSetVerticalAlign(GUIEditor.label[2], "center") Close = guiCreateButton(14, 409, 405, 33, "X", false, wnd) guiSetProperty(Close, "NormalTextColour", "FFFF1200") function getHours() playersTable = {} ; for i, v in ipairs(getElementsByType('player')) do local playerData = getElementData(v, "Time") local Hour, Min, Sec = unpack( split ( playerData, ":" ) ) table.insert(playersTable, {name = v, time = playerData}) end table.sort ( playersTable, function ( a, b ) return ( tostring ( a.time ) or "" ) > ( tostring ( b.time ) or "" ) end ) return playersTable end setTimer(function() --guiSetEnabled(Grid, false) guiSetVisible(Grid, false) guiSetVisible(Grid, true) guiGridListClear(Grid) local Hours = getHours() for one = 1, #getElementsByType('player') do if one >= 40 then return end local item = guiGridListAddRow(Grid) if (Hours[1]) then local itemName = guiGridListSetItemText(Grid, item, 1, one ..'-' .. getPlayerName(Hours[one].name), false, false) local itemName = guiGridListSetItemText(Grid, item, 2, Hours[one].time, false, false) guiGridListSetItemColor(Grid, item, 1, 255, 0, 0) guiGridListSetItemColor(Grid, item, 2, 0, 255, 0) end end end, 1000, 0) addEventHandler( 'onClientGUIClick', root, function() if source == Close then guiSetVisible(wnd, false) showCursor(false) end end ) function open() if guiGetVisible(wnd) == false then guiSetVisible(wnd, true) showCursor(true) else guiSetVisible(wnd, false) showCursor(false) end end bindKey( 'F10', 'down', open) Link to comment
MR.StoRm Posted February 16, 2017 Author Share Posted February 16, 2017 26 minutes ago, iMr.WiFi..! said: function guiCreateWindow( x2, y2, width2, height2, titleBarText2, relative2 ) local mainBackground = guiCreateStaticImage ( x2, y2, width2, height2, "wndow.png", relative2 ) local mainBackgroundLabel = guiCreateLabel ( 0, 0, 950, 300, titleBarText2, false, mainBackground ) guiSetEnabled ( mainBackgroundLabel, false ) return mainBackground end GUIEditor = { label = {} } local screenW, screenH = guiGetScreenSize() wnd = guiCreateStaticImage((screenW - 436) / 2, (screenH - 458) / 2, 436, 458, ":guieditors/images/wndow.png", false) guiSetVisible(wnd,false) Grid = guiCreateGridList(14, 54, 408, 355, false, wnd) guiGridListAddColumn(Grid, "x[ Player Name ]x", 0.5) guiGridListAddColumn(Grid, "x[ Time Player ]x", 0.5) GUIEditor.label[1] = guiCreateLabel(-5, -45, 418, 27, "", false, Grid) GUIEditor.label[2] = guiCreateLabel(7, 9, 419, 24, "=[ TOP 40 Onlines ]=", false, wnd) guiLabelSetColor(GUIEditor.label[2], 255, 0, 0) guiLabelSetHorizontalAlign(GUIEditor.label[2], "center", false) guiLabelSetVerticalAlign(GUIEditor.label[2], "center") Close = guiCreateButton(14, 409, 405, 33, "X", false, wnd) guiSetProperty(Close, "NormalTextColour", "FFFF1200") function getHours() playersTable = {} ; for i, v in ipairs(getElementsByType('player')) do local playerData = getElementData(v, "Time") local Hour, Min, Sec = unpack( split ( playerData, ":" ) ) table.insert(playersTable, {name = v, time = playerData}) end table.sort ( playersTable, function ( a, b ) return ( tostring ( a.time ) or "" ) > ( tostring ( b.time ) or "" ) end ) return playersTable end setTimer(function() --guiSetEnabled(Grid, false) guiSetVisible(Grid, false) guiSetVisible(Grid, true) guiGridListClear(Grid) local Hours = getHours() for one = 1, #getElementsByType('player') do if one >= 40 then return end local item = guiGridListAddRow(Grid) if (Hours[1]) then local itemName = guiGridListSetItemText(Grid, item, 1, one ..'-' .. getPlayerName(Hours[one].name), false, false) local itemName = guiGridListSetItemText(Grid, item, 2, Hours[one].time, false, false) guiGridListSetItemColor(Grid, item, 1, 255, 0, 0) guiGridListSetItemColor(Grid, item, 2, 0, 255, 0) end end end, 1000, 0) addEventHandler( 'onClientGUIClick', root, function() if source == Close then guiSetVisible(wnd, false) showCursor(false) end end ) function open() if guiGetVisible(wnd) == false then guiSetVisible(wnd, true) showCursor(true) else guiSetVisible(wnd, false) showCursor(false) end end bindKey( 'F10', 'down', open) لم يعد يظهر اسم اللاعب أخي ~,~ 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