Wysłany: 2018-09-23, 18:07
JakisPolak199
wieczny student
Wiek: 20 Na forum: 3510 dni Posty: 131
Nick w MP: bover.
Piwa : 905
witam znalazlem jakis tab na komputerze podobny do tego z pylife lecz nie wiem jak dodac do niego kolorki kod:
DXSCOREBOARD_EXPORTS.lua
MAX_PRIRORITY_SLOT = 500
scoreboardColumns = {
{ [ "name" ] = "id" , [ "width" ] = 30 , [ "friendlyName" ] = "ID" , [ "priority" ]= 1 },
{ [ "name" ] = "player:uid" , [ "width" ] = 45 , [ "friendlyName" ] = "UID" , [ "priority" ] = 2 },
{ [ "name" ] = "name" , [ "width" ] = 125 , [ "friendlyName" ] = "Nazwa u?ytkownika" , [ "priority" ] = 3 },
{ [ "name" ] = "player:rp" , [ "width" ] = 85 , [ "friendlyName" ] = "RP" , [ "priority" ]= 4 },
{ [ "name" ] = "player:organization" , [ "width" ] = 100 , [ "friendlyName" ] = "Organizacja" , [ "priority" ]= 5 },
{ [ "name" ] = "player:duty" , [ "width" ] = 85 , [ "friendlyName" ] = "Frakcja" , [ "priority" ]= 6 },
{ [ "name" ] = "ping" , [ "width" ] = 45 , [ "friendlyName" ] = "Ping" , [ "priority" ] = MAX_PRIRORITY_SLOT }
}
resourceColumns = {}
function toboolean ( bool )
bool = tostring ( bool )
if bool == "true" then
return true
elseif bool == "false" then
return false
else
return nil
end
end
forceShowTeams = toboolean ( get ( "forceShowTeams" ) ) or false
forceHideTeams = toboolean ( get ( "forceHideTeams" ) ) or false
allowColorcodedNames = toboolean ( get ( "allowColorcodedNames" ) ) or false
local function iif ( cond , arg1 , arg2 )
if cond then
return arg1
end
return arg2
end
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
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
function scoreboardRemoveColumn ( name , forElement )
if type ( name ) == "string" then
forElement = iif ( type ( forElement ) == "userdata" and isElement ( forElement ), forElement , getRootElement () )
if forElement == getRootElement () then
for key , value in ipairs ( scoreboardColumns ) do
if name == value . name then
table . remove ( scoreboardColumns , key )
for resource , content in pairs ( resourceColumns ) do
table . removevalue ( content , name )
end
return triggerClientEvent ( getRootElement (), "doScoreboardRemoveColumn" , getRootElement (), name )
end
end
else
return triggerClientEvent ( forElement , "doScoreboardRemoveColumn" , getRootElement (), name )
end
end
return false
end
function scoreboardClearColumns ( forElement )
forElement = iif ( type ( forElement ) == "userdata" and isElement ( forElement ), forElement , getRootElement () )
if forElement == getRootElement () then
while ( scoreboardColumns [ 1 ] ) do
table . remove ( scoreboardColumns , 1 )
resourceColumns = {}
end
return triggerClientEvent ( getRootElement (), "doScoreboardClearColumns" , getRootElement () )
else
return triggerClientEvent ( forElement , "doScoreboardClearColumns" , getRootElement () )
end
end
function scoreboardResetColumns ( forElement )
forElement = iif ( type ( forElement ) == "userdata" and isElement ( forElement ), forElement , getRootElement () )
if forElement == getRootElement () then
while ( scoreboardColumns [ 1 ] ) do
table . remove ( scoreboardColumns , 1 )
resourceColumns = {}
end
local result = triggerClientEvent ( getRootElement (), "doScoreboardResetColumns" , getRootElement () )
if result then
scoreboardAddColumn ( "name" , 300 , "Imi? i nazwisko" )
scoreboardAddColumn ( "ping" , 40 , "Ping" )
end
return result
else
return triggerClientEvent ( forElement , "doScoreboardResetColumns" , getRootElement (), false )
end
end
function scoreboardSetForced ( forced , forElement )
if type ( forced ) == "boolean" then
forElement = iif ( type ( forElement ) == "userdata" and isElement ( forElement ), forElement , getRootElement () )
return triggerClientEvent ( forElement , "doScoreboardSetForced" , getRootElement (), forced )
else
return false
end
end
function scoreboardSetSortBy ( name , desc , forElement )
if type ( name ) == "string" or name == nil then
if name == nil then
forElement = iif ( type ( desc ) == "userdata" and isElement ( desc ), desc , getRootElement () )
else
forElement = iif ( type ( forElement ) == "userdata" and isElement ( forElement ), forElement , getRootElement () )
end
desc = iif ( type ( desc ) == "boolean" , desc , true )
return triggerClientEvent ( forElement , "doScoreboardSetSortBy" , getRootElement (), name , desc )
else
return false
end
end
function scoreboardGetColumnPriority ( name )
if type ( name ) == "string" then
for key , value in ipairs ( scoreboardColumns ) do
if name == value . name then
return value . priority
end
end
end
return false
end
function scoreboardSetColumnPriority ( name , priority , forElement )
if type ( name ) == "string" and type ( priority ) == "number" then
if not ( priority > MAX_PRIRORITY_SLOT or priority < 1 ) then
forElement = iif ( type ( forElement ) == "userdata" and isElement ( forElement ), forElement , getRootElement () )
if forElement == getRootElement () then
local columnIndex = false
for key , value in ipairs ( scoreboardColumns ) do
if name == value . name then
columnIndex = key
end
end
if columnIndex then
scoreboardColumns [ columnIndex ]. priority = - 1 -- To empty out the current priority
fixPrioritySlot ( priority )
scoreboardColumns [ columnIndex ]. priority = priority
table . sort ( scoreboardColumns , function ( a , b ) return a . priority < b . priority end )
return triggerClientEvent ( forElement , "doScoreboardSetColumnPriority" , getRootElement (), name , priority )
end
else
return triggerClientEvent ( forElement , "doScoreboardSetColumnPriority" , getRootElement (), name , priority )
end
end
end
return false
end
function scoreboardForceTeamsVisible ( enabled )
if type ( enabled ) == "boolean" then
forceShowTeams = enabled
return true
end
return false
end
function scoreboardForceTeamsHidden ( enabled )
if type ( enabled ) == "boolean" then
forceHideTeams = enabled
return true
end
return false
end
function scoreboardGetColumnCount ()
return #scoreboardColumns
end
function onClientDXScoreboardResourceStart ()
for key , column in ipairs ( scoreboardColumns ) do
triggerClientEvent ( client , "doScoreboardAddColumn" , getRootElement (), column . name , column . width , column . friendlyName , column . priority )
end
end
addEvent ( "onClientDXScoreboardResourceStart" , true )
addEventHandler ( "onClientDXScoreboardResourceStart" , getResourceRootElement ( getThisResource () ), onClientDXScoreboardResourceStart )
function requestServerInfo ()
local mapmanager = getResourceFromName ( "mapmanager" )
local output = {}
output . forceshowteams = forceShowTeams
output . forcehideteams = forceHideTeams
output . allowcolorcodes = allowColorcodedNames
output . server = getServerName ()
output . players = getMaxPlayers ()
output . gamemode = false
output . map = false
if mapmanager and getResourceState ( mapmanager ) == "running" then
local gamemode = exports . mapmanager : getRunningGamemode ()
if gamemode then
output . gamemode = getResourceInfo ( gamemode , "name" ) or getResourceName ( gamemode )
end
local map = exports . mapmanager : getRunningGamemodeMap ()
if map then
output . map = getResourceInfo ( map , "name" ) or getResourceName ( map )
end
end
triggerClientEvent ( client , "sendServerInfo" , getRootElement (), output )
end
addEvent ( "requestServerInfo" , true )
addEventHandler ( "requestServerInfo" , getResourceRootElement ( getThisResource () ), requestServerInfo )
function removeResourceScoreboardColumns ( resource )
if resourceColumns [ resource ] then
while resourceColumns [ resource ][ 1 ] do
local success = scoreboardRemoveColumn ( resourceColumns [ resource ][ 1 ], getRootElement () )
if not success then break end
end
resourceColumns [ resource ] = nil
end
end
addEventHandler ( "onResourceStop" , getRootElement (), removeResourceScoreboardColumns )
-- Compability
addScoreboardColumn = function( name , forElement , position , size )
if type ( size ) == "number" and size >= 0 and size <= 1.0 then
size = size * 700
end
return scoreboardAddColumn ( name , forElement , size , name , position )
end
removeScoreboardColumn = scoreboardRemoveColumn
resetScoreboardColumns = scoreboardResetColumns
setPlayerScoreboardForced = function( forElement , forced ) return scoreboardSetForced ( forced , forElement ) end
Stawiam piwko i repe za pomoc
jak trzeba jeszcze jakis plik podac to napiszcie podam
Wysłany: 2018-09-23, 18:56
Kalizman
Wiek: 23 Na forum: 3651 dni Posty: 1394
Piwa : 4619
Opisz dok?adniej co chcia?by? uzyska?, bo nie rozumiem za bardzo Twojego tematu.
Wysłany: 2018-09-24, 10:39
_jvneczek
Wiek: 22 Na forum: 4326 dni Posty: 1513
Nick w MP: _jvneczek
Piwa : 3949
Kalizman , Jemu zapewne chodzi o to ?e pod tabem pokazuje sie np #ff0000(nick)
a chce ?eby zamiast pokazywa?o #ff0000 to chce ?eby kolor nicku si? zmienia?.
Podpis
Support Team: 04.10.2020 - 01.09.2020
Test Moderator: 03.05.2021 - 01.09.2021
Moderator: 01.09.2021 - 23.10.2021
Wysłany: 2018-09-24, 13:05
JakisPolak199
wieczny student
Wiek: 20 Na forum: 3510 dni Posty: 131
Nick w MP: bover.
Piwa : 905
Wysłany: 2018-09-24, 13:37
_jvneczek
Wiek: 22 Na forum: 4326 dni Posty: 1513
Nick w MP: _jvneczek
Piwa : 3949
JakisPolak199 , M?g?by? podes?a? ca?y skrypt? zrobi?bym to u siebie i bym ci podes?a? kod
Podpis
Support Team: 04.10.2020 - 01.09.2020
Test Moderator: 03.05.2021 - 01.09.2021
Moderator: 01.09.2021 - 23.10.2021
Tagi: kolorki :: pod :: tabem
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: