Jump to content

Scoreboard Desynchronization


Recommended Posts

Q2YBdG.png[/url]

function scoreboardAddColumn( name, forElement, width, friendlyName, priority )
	if type( name ) == "string" then
		width = tonumber( width ) or 70
		friendlyName = friendlyName or name
		priority = tonumber( priority ) or getNextFreePrioritySlot( scoreboardGetColumnPriority( "name" ) )
		fixPrioritySlot( priority )
		forElement = iif( type( forElement ) == "userdata" and isElement( forElement ), forElement, getRootElement() )
		
		if forElement == getRootElement() then
			if not (priority > MAX_PRIRORITY_SLOT or priority < 1) then ---45.dize
				for key, value in ipairs( scoreboardColumns ) do
					if name == value.name then
						return false
					end
				end
				table.insert( scoreboardColumns, { ["name"] = name, ["width"] = width, ["friendlyName"] = friendlyName, ["priority"] = priority } )
				table.sort( scoreboardColumns, function ( a, b ) return a.priority < b.priority end )
				if sourceResource then
					if not resourceColumns[sourceResource] then resourceColumns[sourceResource] = {} end
					table.insert ( resourceColumns[sourceResource], name )
				end
				return triggerClientEvent( getRootElement(), "doScoreboardAddColumn", getRootElement(), name, width, friendlyName, priority, sourceResource )
			end
		else
			return triggerClientEvent( forElement, "doScoreboardAddColumn", getRootElement(), name, width, friendlyName, priority, sourceResource )
		end
	end
	return false
end
Link to comment
4 hours ago, MrTasty said:

Image doesn't work, and you haven't even bothered describing/explaining the issue a bit more, or what your desired outcome is.

Warning:dx_scoreboardexports.lua:45 setElementData Modifying players before on player Join can cause desynchrozation.

This warning is bothering me.What should I do?

Edited by Yurigarga
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...