MA[S]RIY Posted May 20, 2017 Share Posted May 20, 2017 السلام عليكم الكود ذا GUIEditor_Grid = {} wnd = guiCreateWindow(249,102,312,455,"#اسماء_الاعبين_بالسرفر",false) GUIEditor_Grid[1] = guiCreateGridList(9,24,294,422,false,wnd) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) guiSetVisible(wnd,false) guiWindowSetMovable(wnd,false) function OpenWin() if guiGetVisible ( wnd ) then guiSetVisible ( wnd, false ) showCursor(false) guiSetInputEnabled(false) else guiSetVisible ( wnd, true ) showCursor(true) guiSetInputEnabled(true) end end bindKey("F7", "down", OpenWin) local col = guiGridListAddColumn(GUIEditor_Grid[1],"Player name",0.90) local coll = guiGridListAddColumn(GUIEditor_Grid[1],"Player account",0.90) for id,player in ipairs( getElementsByType ( "player" ) ) do local row = guiGridListAddRow ( GUIEditor_Grid[1] ) guiGridListSetItemText ( GUIEditor_Grid[1], row, col, getPlayerName ( player ), false, false ) guiGridListSetItemText ( GUIEditor_Grid[1], row, coll, getAccountName ( getPlayerAccount ( player ) ), false, false ) end المفروض انو يجيب في جريد ليست جميع حسابات واسامي الاعبين الي بالسرفر هو يجيب الاسم عادي لاكن الحسابات م يجيبها ارجو التعديل Link to comment
Adham Posted May 20, 2017 Share Posted May 20, 2017 وظائف كلنت مع وظائف سرفر ماشاء الله لازم تسوي تريقر Link to comment
MA[S]RIY Posted May 20, 2017 Author Share Posted May 20, 2017 اوف م اخذت بالي من جيت اكونت بلاير سرفر طيب وش ارسل في الترايقر Link to comment
#BrosS Posted May 20, 2017 Share Posted May 20, 2017 (edited) حط جدول بالسيرفر وضيف فيه لاعبين وحسابهم وارسله بالترايقر وحطه بالجريد لست :3 #Edit: مو ضروري جدول Edited May 20, 2017 by #BrosS Link to comment
Adham Posted May 20, 2017 Share Posted May 20, 2017 جرب -- Client addEvent ( "GetPlayers", true ) addEventHandler ( "GetPlayers", root, function ( accounts, playerName ) local row = guiGridListAddRow ( GUIEditor_Grid[1] ) guiGridListSetItemText ( GUIEditor_Grid[1], row, col, playerName, false, false ) guiGridListSetItemText ( GUIEditor_Grid[1], row, coll, accounts, false, false ) end ) -- Server function getAccountsAndName ( ) for i,v in ipairs( getElementsByType ( "player" ) ) do local playerName = getPlayerName ( v ) local accounts = getAccountName ( getPlayerAccount ( v ) ) triggerClientEvent ( root,"GetPlayers", root,playerName,accounts) end end getAccountsAndName ( ) Link to comment
#BrosS Posted May 20, 2017 Share Posted May 20, 2017 @Deativated المفروض تتحقق انه اللاعب مسجل دخوله ومعرف الفنكشن اخر سطر سيرفر عالفاضي فيه اكواد ناقصة Link to comment
iMr.WiFi..! Posted May 21, 2017 Share Posted May 21, 2017 تقدر تشوف مود الاسل حقي , وكيف سويته مع الحسابات : ) بتوفيق لك Link to comment
MA[S]RIY Posted May 21, 2017 Author Share Posted May 21, 2017 طيب ممكن احد يعدلو لي يا شباب Link to comment
!#NssoR_) Posted May 21, 2017 Share Posted May 21, 2017 16 hours ago, Deativated said: جرب -- Client addEvent ( "GetPlayers", true ) addEventHandler ( "GetPlayers", root, function ( accounts, playerName ) local row = guiGridListAddRow ( GUIEditor_Grid[1] ) guiGridListSetItemText ( GUIEditor_Grid[1], row, col, playerName, false, false ) guiGridListSetItemText ( GUIEditor_Grid[1], row, coll, accounts, false, false ) end ) -- Server function getAccountsAndName ( ) for i,v in ipairs( getElementsByType ( "player" ) ) do local playerName = getPlayerName ( v ) local accounts = getAccountName ( getPlayerAccount ( v ) ) triggerClientEvent ( root,"GetPlayers", root,playerName,accounts) end end getAccountsAndName ( ) إذا قمت بعمل الترايقر بهذا الشكل سيأثر علي السيرفر( اذا كان عدد لاعبينك 50 ومافوق ) بسبب تكرار الترايقر بعدد اللاعبين المتواجدين بالسيرفر 1 Link to comment
MA[S]RIY Posted May 22, 2017 Author Share Posted May 22, 2017 طيب ممكن يا اخي تعدلو انت Link to comment
#BrosS Posted May 22, 2017 Share Posted May 22, 2017 -- Server # function TAc() for i, players in ipairs( getElementsByType("player") ) do local account = getPlayerAccount(players) if account and not isGuestAccount(account) then account = getAccountName(account) else account = "N/A" end setElementData(player, "Account", account) end end addEventHandler("onResourceStart", resourceRoot,TAc) addEventHandler("onPlayerJoin", root,TAc) addEventHandler("onPlayerChangeNick", root,TAc) -- Client # guiGridListSetItemText ( GUIEditor_Grid[1], row, columen, ""..getElementData(player,"Account").."", false, false ) غير ارجمنتات الجريد لست الى حقك حسب اللاعب اللي تبغاه والكولومن الخ.. Link to comment
^iiEcoo'x_) Posted May 22, 2017 Share Posted May 22, 2017 @#BrosS طريقتك غلط , لازم تسوي لوب للجميع الحسابات بالسيرفر عشان تجيب الحسابات Link to comment
#BrosS Posted May 22, 2017 Share Posted May 22, 2017 2 hours ago, #_iMr.[E]coo said: @#BrosS طريقتك غلط , لازم تسوي لوب للجميع الحسابات بالسيرفر عشان تجيب الحسابات شيعرفني انه يبي كل الحسابات ظنتته يبي اللاعب اللي بالسيرفر فقط Link to comment
Master_MTA Posted May 22, 2017 Share Posted May 22, 2017 (edited) ---------سيرفر addEvent('getAccounts',true) addEventHandler('getAccounts',root,function() local el=getElementsByType('player') local thetable={} for k,v in ipairs(el)do local acc=getPlayerAccount(v) if not isGuestAccount(acc)then table.insert(thetable,{getAccountName(acc),getPlayerName(v)}) else table.insert(thetable,{'Guest',getPlayerName(v)}) end end triggerClientEvent(source,'setgrid',source,thetable) end) --------client triggerServerEvent('getAccounts',localPlayer) addEvent('setgrid',true) addEventHandler('setgrid',root,function(t) for k,v in ipairs(t)do guiGridListSetItemText(blallballbalbla----v[1])------acc name guiGridListSetItemText(blallballbalbla----v[2])------player name end end) بالتوفيق Edited May 22, 2017 by Master_MTA 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