iMr.WiFi..! Posted June 4, 2016 Share Posted June 4, 2016 انا وقفت لهنا لاني معرفت وش اسوي يليلت واحد يكمله ,! 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 ' TopKill = guiCreateGridList(0.42, 0.31, 0.17, 0.36, true) col = guiGridListAddColumn(TopKill,"Num :",0.30) col2 = guiGridListAddColumn(TopKill,"Name :",0.60) col3 = guiGridListAddColumn(TopKill,"Kills :",0.85) for i = 1,10 do local Row = guiGridListAddRow(TopKill) guiGridListSetItemText(TopKill,Row,1,""..i.."",false,false) end local screenW, screenH = guiGetScreenSize() addEventHandler("onClientRender", root, function() dxDrawLine(746 - 1, 299 - 1, 746 - 1, 782, tocolor(255, 255, 255, 255), 1, false) dxDrawLine(1175, 299 - 1, 746 - 1, 299 - 1, tocolor(255, 255, 255, 255), 1, false) dxDrawLine(746 - 1, 782, 1175, 782, tocolor(255, 255, 255, 255), 1, false) dxDrawLine(1175, 782, 1175, 299 - 1, tocolor(255, 255, 255, 255), 1, false) dxDrawRectangle((screenW - 429) / 2, (screenH - 483) / 2, 429, 483, tocolor(240, 32, 32, 255), false) dxDrawLine(746 - 1, 245 - 1, 746 - 1, 294, tocolor(255, 255, 255, 255), 1, false) dxDrawLine(1175, 245 - 1, 746 - 1, 245 - 1, tocolor(255, 255, 255, 255), 1, false) dxDrawLine(746 - 1, 294, 1175, 294, tocolor(255, 255, 255, 255), 1, false) dxDrawLine(1175, 294, 1175, 245 - 1, tocolor(255, 255, 255, 255), 1, false) dxDrawRectangle(746, 245, 429, 49, tocolor(240, 32, 32, 255), false) dxDrawText("[ F4 ] | Top Killers | [ F4 ]", 744, 244, 1175, 294, tocolor(0, 0, 0, 255), 0.90, "bankgothic", "center", "center", false, false, false, false, false) dxDrawRectangle(797, 333, 322, 388, tocolor(255, 255, 255, 255), false) end ) Kills = {} addEventHandler("onPlayerWasted1",root,function ( _,Killer ) Kills[Killer] = 0 Kills[Killer] = Kills[Killer] + 1 table.sort(Kills, function(a, b) return(tonumber(a[2]) or 0) > (tonumber(b[2]) or 0) end) setElementData(Killer,"Data") setElementData(Killer,"YP",getElementData(Killer,"Data") or 0 ) + Kills[Killer] end ) المود توب 10 لاعبين في الكيل انا معرفت حاجات بالاختصار 3 اشياء احط الكيلات و الاسامي داخل الجريد ليست يعني كذا Id Name kills 1 iMr.WiFi 15 شيء ثاني معرفت اخليهم فقط 10 وثالث شيء ادخل اسم لاعب و الكيل Link to comment
فاّرس Posted June 4, 2016 Share Posted June 4, 2016 انت مخبص.. لازم تسوي تحقق من الكيلر وانه مايكون اللاعب قتل نفسه يعني طاح او قنبله ... ثم تزود المتغير بعد التحقق وبعد م تخلص ترتب الجدول وتحفظه ف سكل او اي شي .. الاكواد مضروبه, حاول مره ثانيه .. Link to comment
iMr.WiFi..! Posted June 4, 2016 Author Share Posted June 4, 2016 انت مخبص..لازم تسوي تحقق من الكيلر وانه مايكون اللاعب قتل نفسه يعني طاح او قنبله ... ثم تزود المتغير بعد التحقق وبعد م تخلص ترتب الجدول وتحفظه ف سكل او اي شي .. الاكواد مضروبه, حاول مره ثانيه .. وش تقصد بحفظ الجدول ؟ Link to comment
iMr.WiFi..! Posted June 4, 2016 Author Share Posted June 4, 2016 --Client 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 ' TopKill = guiCreateGridList(0.42, 0.31, 0.17, 0.36, true) col = guiGridListAddColumn(TopKill,"Num :",0.30) col2 = guiGridListAddColumn(TopKill,"Name :",0.60) changeGridListItemToPlayersName(TopKill,col2) col3 = guiGridListAddColumn(TopKill,"Kills :",0.85) for i = 1,10 do local Row = guiGridListAddRow(TopKill) guiGridListSetItemText(TopKill,Row,1,""..i.."",false,false) end local screenW, screenH = guiGetScreenSize() addEventHandler("onClientRender", root, function() dxDrawLine(746 - 1, 299 - 1, 746 - 1, 782, tocolor(255, 255, 255, 255), 1, false) dxDrawLine(1175, 299 - 1, 746 - 1, 299 - 1, tocolor(255, 255, 255, 255), 1, false) dxDrawLine(746 - 1, 782, 1175, 782, tocolor(255, 255, 255, 255), 1, false) dxDrawLine(1175, 782, 1175, 299 - 1, tocolor(255, 255, 255, 255), 1, false) dxDrawRectangle((screenW - 429) / 2, (screenH - 483) / 2, 429, 483, tocolor(240, 32, 32, 255), false) dxDrawLine(746 - 1, 245 - 1, 746 - 1, 294, tocolor(255, 255, 255, 255), 1, false) dxDrawLine(1175, 245 - 1, 746 - 1, 245 - 1, tocolor(255, 255, 255, 255), 1, false) dxDrawLine(746 - 1, 294, 1175, 294, tocolor(255, 255, 255, 255), 1, false) dxDrawLine(1175, 294, 1175, 245 - 1, tocolor(255, 255, 255, 255), 1, false) dxDrawRectangle(746, 245, 429, 49, tocolor(240, 32, 32, 255), false) dxDrawText("[ F4 ] | Top Killers | [ F4 ]", 744, 244, 1175, 294, tocolor(0, 0, 0, 255), 0.90, "bankgothic", "center", "center", false, false, false, false, false) dxDrawRectangle(797, 333, 322, 388, tocolor(255, 255, 255, 255), false) end ) --Server Kills = {} executeSQLQuery("CREATE TABLE IF NOT EXISTS `Killer` (`Serial` TEXT, `Name` TEXT, `Kills` TEXT)") addEventHandler("onPlayerWasted",root,function ( _,Killer ) if ( Killer == source and getElementData(Killer) ~= "player" and not Killer ) then return end local playerSerial = getPlayerSerial( Killer ) local playerName = getPlayerName( Killer ) local Sel = executeSQLQuery("SELECT * FROM players WHERE Serial=?", playerSerial) Kills[Killer] = 0 Kills[Killer] = Kills[Killer] + 1 KillsS = Kills[Killer] + 1 table.sort(Kills, function(a, b) return(tonumber(a[2]) or 0) > (tonumber(b[2]) or 0) end) if ( type(Sel) == "table" and #Sel == 0 or not Sel ) then executeSQLQuery(" INSERT INTO `TablSave` (Serial, Name, Kills) VALUES(?, ?, ?)",playerSerial,playerName,KillsS) else setElementData(Killer,"Data") setElementData(Killer,"YP",getElementData(Killer,"Data") or 0 ) + Kills[Killer] executeSQLQuery(" UPDATE `TablSave` SET Serial = ?, Name = ?, Kills = ?",playerSerial,playerName,getElementData(Killer,"YP")) end end ) Link to comment
nxFairlywell Posted June 4, 2016 Share Posted June 4, 2016 ما ازود على كلام اخوي ذا بست بس فيه وظائف مهمة نسيتها مثل table.insert table.sort Link to comment
iMr.WiFi..! Posted June 4, 2016 Author Share Posted June 4, 2016 --Client 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 ' TopKill = guiCreateGridList(0.42, 0.31, 0.17, 0.36, true) col = guiGridListAddColumn(TopKill,"Num :",0.30) col2 = guiGridListAddColumn(TopKill,"Name :",0.60) col3 = guiGridListAddColumn(TopKill,"Kills :",0.85) for i = 1,10 do local Row = guiGridListAddRow(TopKill) guiGridListSetItemText(TopKill,Row,1,""..i.."",false,false) end local screenW, screenH = guiGetScreenSize() addEventHandler("onClientRender", root, function() dxDrawLine(746 - 1, 299 - 1, 746 - 1, 782, tocolor(255, 255, 255, 255), 1, false) dxDrawLine(1175, 299 - 1, 746 - 1, 299 - 1, tocolor(255, 255, 255, 255), 1, false) dxDrawLine(746 - 1, 782, 1175, 782, tocolor(255, 255, 255, 255), 1, false) dxDrawLine(1175, 782, 1175, 299 - 1, tocolor(255, 255, 255, 255), 1, false) dxDrawRectangle((screenW - 429) / 2, (screenH - 483) / 2, 429, 483, tocolor(240, 32, 32, 255), false) dxDrawLine(746 - 1, 245 - 1, 746 - 1, 294, tocolor(255, 255, 255, 255), 1, false) dxDrawLine(1175, 245 - 1, 746 - 1, 245 - 1, tocolor(255, 255, 255, 255), 1, false) dxDrawLine(746 - 1, 294, 1175, 294, tocolor(255, 255, 255, 255), 1, false) dxDrawLine(1175, 294, 1175, 245 - 1, tocolor(255, 255, 255, 255), 1, false) dxDrawRectangle(746, 245, 429, 49, tocolor(240, 32, 32, 255), false) dxDrawText("[ F4 ] | Top Killers | [ F4 ]", 744, 244, 1175, 294, tocolor(0, 0, 0, 255), 0.90, "bankgothic", "center", "center", false, false, false, false, false) dxDrawRectangle(797, 333, 322, 388, tocolor(255, 255, 255, 255), false) end ) --Server Kills = {} executeSQLQuery("CREATE TABLE IF NOT EXISTS `Killer` (`Serial` TEXT, `Name` TEXT, `Kills` TEXT)") addEventHandler("onPlayerWasted",root,function ( _,Killer ) if ( Killer == source and getElementData(Killer) ~= "player" and not Killer ) then return end local playerSerial = getPlayerSerial( Killer ) local playerName = getPlayerName( Killer ) local Sel = executeSQLQuery("SELECT * FROM players WHERE Serial=?", playerSerial) Kills[Killer] = 0 Kills[Killer] = Kills[Killer] + 1 KillsS = Kills[Killer] + 1 if ( type(Sel) == "table" and #Sel == 0 or not Sel ) then executeSQLQuery(" INSERT INTO `TablSave` (Serial, Name, Kills) VALUES(?, ?, ?)",playerSerial,playerName,KillsS) table.insert(Kills,1,playerSerial,playerName,KillsS) else setElementData(Killer,"Data") setElementData(Killer,"YP",getElementData(Killer,"Data") or 0 ) + Kills[Killer] executeSQLQuery(" UPDATE `TablSave` SET Serial = ?, Name = ?, Kills = ?",playerSerial,playerName,getElementData(Killer,"YP")) table.sort(Kills, function(a, b) return(tonumber(a[2]) or 0) > (tonumber(b[2]) or 0) end) end end ) Link to comment
فاّرس Posted June 5, 2016 Share Posted June 5, 2016 -- #Client Side local screenW, screenH = guiGetScreenSize() dx = function() dxDrawLine(746 - 1, 299 - 1, 746 - 1, 782, tocolor(255, 255, 255, 255), 1, false) dxDrawLine(1175, 299 - 1, 746 - 1, 299 - 1, tocolor(255, 255, 255, 255), 1, false) dxDrawLine(746 - 1, 782, 1175, 782, tocolor(255, 255, 255, 255), 1, false) dxDrawLine(1175, 782, 1175, 299 - 1, tocolor(255, 255, 255, 255), 1, false) dxDrawRectangle((screenW - 429) / 2, (screenH - 483) / 2, 429, 483, tocolor(240, 32, 32, 255), false) dxDrawLine(746 - 1, 245 - 1, 746 - 1, 294, tocolor(255, 255, 255, 255), 1, false) dxDrawLine(1175, 245 - 1, 746 - 1, 245 - 1, tocolor(255, 255, 255, 255), 1, false) dxDrawLine(746 - 1, 294, 1175, 294, tocolor(255, 255, 255, 255), 1, false) dxDrawLine(1175, 294, 1175, 245 - 1, tocolor(255, 255, 255, 255), 1, false) dxDrawRectangle(746, 245, 429, 49, tocolor(240, 32, 32, 255), false) dxDrawText("[ F4 ] | Top Killers | [ F4 ]", 744, 244, 1175, 294, tocolor(0, 0, 0, 255), 0.90, "bankgothic", "center", "center", false, false, false, false, false) dxDrawRectangle(797, 333, 322, 388, tocolor(255, 255, 255, 255), false) end function isEventHandlerAdded( sEventName, pElementAttachedTo, func ) if type( sEventName ) == 'string' and isElement( pElementAttachedTo ) and type( func ) == 'function' then local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo ) if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then for i, v in ipairs( aAttachedFunctions ) do if v == func then return true end end end end return false end TopKill = guiCreateGridList(0.42, 0.31, 0.17, 0.36, true) guiSetVisible(TopKill,false) col = guiGridListAddColumn(TopKill,"Num :",0.30) col2 = guiGridListAddColumn(TopKill,"Name :",0.60) col3 = guiGridListAddColumn(TopKill,"Kills :",0.85) bindKey('f4','down', function() guiSetVisible (TopKill, not guiGetVisible(TopKill)) showCursor ( guiGetVisible ( TopKill ) ) if isEventHandlerAdded ("onClientRender", root,dx) then removeEventHandler("onClientRender", root,dx) else triggerServerEvent( 'getData', localPlayer ) addEventHandler("onClientRender", root,dx) end end) addEvent( 'setData', true ) addEventHandler ( 'setData', root, function(data) guiGridListClear ( TopKill ) table.sort ( data, function (a,b) return ( tonumber(a.Kills) or 0 ) > ( tonumber(b.Kills) or 0 )end) for k,v in ipairs ( data ) do local Row = guiGridListAddRow(TopKill) guiGridListSetItemText(TopKill,Row,1,k,false,false) guiGridListSetItemText(TopKill,Row,2,v.Name,false,false) guiGridListSetItemText(TopKill,Row,3,v.Kills,false,false) if k == 10 then break end -- هذا بس 10 ويوقف تقدر تعدله او تحذف السطر . end end) -- #Server Side .. Kills_ = {} addEventHandler('onResourceStart',resourceRoot,function () executeSQLQuery("CREATE TABLE IF NOT EXISTS `Killer` ( Serial, Name, Kills )") end ) addEventHandler("onPlayerWasted",root,function ( _,Killer ) if ( Killer and Killer ~= source and getElementType(Killer) == "player" ) then local playerSerial = getPlayerSerial( Killer ) local playerName = getPlayerName( Killer ) if not Kills_[Killer] then Kills_[Killer] = 0; end Kills_[Killer] = Kills_[Killer] + 1 local Sel = executeSQLQuery("SELECT * FROM `Killer` WHERE Serial=?", playerSerial) if ( type ( Sel ) == "table" and #Sel == 0 or not Sel ) then executeSQLQuery(" INSERT INTO `Killer` (Serial, Name, Kills) VALUES(?,?,?)",playerSerial,playerName,Kills_[Killer]) else executeSQLQuery(" UPDATE `Killer` SET Name =?, Kills =? WHERE Serial=?",playerName,Kills_[Killer],playerSerial) end end end) addEvent ( 'getData', true) addEventHandler ( 'getData', root, function() local db = executeSQLQuery("SELECT * FROM `Killer` ") if ( type ( db ) == "table" and #db == 0 or not db ) then return end triggerClientEvent ( source, 'setData', source, db ) end ) سطر 67 بالكلينت, هذا يجيب لك اعلى عشره تقدر تعدله, وللمعلوميه اذا كنت فاتح النافذه ما راح يحدث, يعني هو م بيحدث الا اذا فتحت النافذه 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