#Major . Posted June 21, 2018 Share Posted June 21, 2018 nonshowing = { ["my Serial"] = true, } function SetPlayersInGD( GridList ) if GridList then if getElementType ( GridList ) == "gui-gridlist" then if guiGridListClear ( GridList ) then for i, v in next, getElementsByType ( "player" ) do local Row = guiGridListAddRow ( GridList ) guiGridListSetItemText ( GridList, Row, 1, getPlayerName ( v ), false, false ) if ( nonshowing[getPlayerSerial(v)] ~= true ) then guiGridListSetItemText ( GridList, Row, 2, getPlayerTime( v ), false, false ) guiGridListSetItemColor(GridList, 0, 1, 255, 0, 0, 255, true, false) guiGridListSetItemColor(GridList, 0, 2, 0, 255, 0, 255, true, false) end end end end end end السلام عليكم بختصار م ابي اسمي يطلع Link to comment
Master_MTA Posted June 21, 2018 Share Posted June 21, 2018 nonshowing = { ["my Serial"] = true, } function SetPlayersInGD( GridList ) if GridList then if getElementType ( GridList ) == "gui-gridlist" then if guiGridListClear ( GridList ) then for i, v in next, getElementsByType ( "player" ) do local Row = guiGridListAddRow ( GridList ) if ( not nonshowing[getPlayerSerial(v)] ) then guiGridListSetItemText ( GridList, Row, 1, getPlayerName ( v ), false, false ) guiGridListSetItemText ( GridList, Row, 2, getPlayerTime( v ), false, false ) guiGridListSetItemColor(GridList, 0, 1, 255, 0, 0, 255, true, false) guiGridListSetItemColor(GridList, 0, 2, 0, 255, 0, 255, true, false) end end end end end end have a good day Link to comment
#Major . Posted June 21, 2018 Author Share Posted June 21, 2018 4 minutes ago, Master_MTA said: nonshowing = { ["my Serial"] = true, } function SetPlayersInGD( GridList ) if GridList then if getElementType ( GridList ) == "gui-gridlist" then if guiGridListClear ( GridList ) then for i, v in next, getElementsByType ( "player" ) do local Row = guiGridListAddRow ( GridList ) if ( not nonshowing[getPlayerSerial(v)] ) then guiGridListSetItemText ( GridList, Row, 1, getPlayerName ( v ), false, false ) guiGridListSetItemText ( GridList, Row, 2, getPlayerTime( v ), false, false ) guiGridListSetItemColor(GridList, 0, 1, 255, 0, 0, 255, true, false) guiGridListSetItemColor(GridList, 0, 2, 0, 255, 0, 255, true, false) end end end end end end have a good day المشكلة مو من صيغة التحقق المشكله انه لما حطيت تحقق ع السريال صرت انا م اشوف القريد ليست بكبرها بس غيري يشوفه Link to comment
Master_MTA Posted June 21, 2018 Share Posted June 21, 2018 2 minutes ago, *RayaN-Alharbi. said: المشكلة مو من صيغة التحقق المشكله انه لما حطيت تحقق ع السريال صرت انا م اشوف القريد ليست بكبرها بس غيري يشوفه yup sry nonshowing = { ["my Serial"] = true, } function getTableWithout() local all=getElementsByType ( "player" ) local ta={} for k,v in ipairs(all)do if (not nonshowing[getPlayerSerial(v)])then table.insert(ta,{name=getPlayerName(v),time=getPlayerTime(v)}) end end return ta end function SetPlayersInGD( GridList ) if GridList then if getElementType ( GridList ) == "gui-gridlist" then if guiGridListClear ( GridList ) then for i, v in next,getTableWithout() do local Row = guiGridListAddRow ( GridList ) guiGridListSetItemText ( GridList, Row, 1, v.name, false, false ) guiGridListSetItemText ( GridList, Row, 2, v.time, false, false ) guiGridListSetItemColor(GridList, 0, 1, 255, 0, 0, 255, true, false) guiGridListSetItemColor(GridList, 0, 2, 0, 255, 0, 255, true, false) end end end end end test it 11 minutes ago, *RayaN-Alharbi. said: المشكلة مو من صيغة التحقق المشكله انه لما حطيت تحقق ع السريال صرت انا م اشوف القريد ليست بكبرها بس غيري يشوفه اعذرني يقلبي عرفت من وين المشكله المشكله من getPlayerSerial عشان كذا نقولك استخدمه سيرفر سايد لانه بالكلنت يجيب سيريال اللاعب اللوكال فقط 1 Link to comment
Rakan# Posted June 21, 2018 Share Posted June 21, 2018 سوي داتا بالسيرفر onplayerjoin وحط له داتا السيريال واستعمل الداتا للتحقق بالكلنت Link to comment
^iiEcoo'x_) Posted June 21, 2018 Share Posted June 21, 2018 . isTextInGridList إستخدم اليوزفل فنكشن Link to comment
Rockyz Posted June 21, 2018 Share Posted June 21, 2018 (edited) --SERVER SIDE: function serial( ) if eventName == 'onResourceStart' then for k, v in ipairs(getElementsByType('player')) do setElementData(v, 'serial', getPlayerSerial(v)) end else setElementData(source, 'serial', getPlayerSerial(source)) end end addEventHandler('onResourceStart', resourceRoot, serial) addEventHandler('onPlayerJoin', root, serial) --CLIENT SIDE nonshowing = { ['my Serial'] = true, } function SetPlayersInGD(grid) if grid then if getElementType(grid) == 'gui-gridlist' then if guiGridListClear(grid) then for _, player in ipairs(getElementsByType('player')) do if not nonshowing[getPlayerSerial(player)] then local row = guiGridListAddRow(grid) guiGridListSetItemText(grid, row, 1, getPlayerName(player), false, false ) guiGridListSetItemText(grid, row, 2, getPlayerTime(player), false, false ) guiGridListSetItemColor(grid, 0, 1, 255, 0, 0, 255, true, false) guiGridListSetItemColor(grid, 0, 2, 0, 255, 0, 255, true, false) end end end end end end _getSerial = getPlayerSerial function getPlayerSerial(p) return (isElement(p) and getElementType(p) == 'player') and getElementData(p, 'serial') or _getSerial() end Edited June 21, 2018 by #,+( _xiRoc[K]; > Link to comment
#Major . Posted June 22, 2018 Author Share Posted June 22, 2018 19 hours ago, Master_MTA said: yup sry nonshowing = { ["my Serial"] = true, } function getTableWithout() local all=getElementsByType ( "player" ) local ta={} for k,v in ipairs(all)do if (not nonshowing[getPlayerSerial(v)])then table.insert(ta,{name=getPlayerName(v),time=getPlayerTime(v)}) end end return ta end function SetPlayersInGD( GridList ) if GridList then if getElementType ( GridList ) == "gui-gridlist" then if guiGridListClear ( GridList ) then for i, v in next,getTableWithout() do local Row = guiGridListAddRow ( GridList ) guiGridListSetItemText ( GridList, Row, 1, v.name, false, false ) guiGridListSetItemText ( GridList, Row, 2, v.time, false, false ) guiGridListSetItemColor(GridList, 0, 1, 255, 0, 0, 255, true, false) guiGridListSetItemColor(GridList, 0, 2, 0, 255, 0, 255, true, false) end end end end end test it اعذرني يقلبي عرفت من وين المشكله المشكله من getPlayerSerial عشان كذا نقولك استخدمه سيرفر سايد لانه بالكلنت يجيب سيريال اللاعب اللوكال فقط خلاص شكرا ارسلتها بتراقر من السيرفر للكلانت وانتهت المشكله 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