Jump to content

قريد ليست [مساعدة]


Recommended Posts

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
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
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
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

عشان كذا نقولك استخدمه سيرفر سايد

لانه بالكلنت يجيب سيريال اللاعب اللوكال فقط

  • Like 1
Link to comment
--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 by #,+( _xiRoc[K]; >
Link to comment
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...