Hamer Fivem
StoreYoutubeCfx.re
  • About Us
  • SCRIPTS
    • ArenaAPI
      • Server Side
      • Client Side
      • Common Issue
    • ArenaLobby
    • DarkRP_Racing
      • Config
      • DLC
        • Sumo
        • Sumo Remix
        • Deadline
        • Hunting Pack
        • Timed
        • Street
        • Runner vs Vehicle
      • Map Editor (PointMarker)
      • Scoreboard Text Format
      • Exports
      • Checkpoint Icon
      • Common Issue
      • Update Logs
    • DarkRP_ZombieSurvival
      • Config
      • Common Issue
      • Exports
    • DarkRP_Bomb
      • Config
      • Common Issue
      • Exports
    • DarkRP_CaptureTheFlag
      • Config
      • Common Issue
      • Exports
    • DarkRP_Deathmacth
      • Config
      • Common Issue
      • Exports
      • DLC
    • DarkRP_Teamdeathmacth
      • Config
      • Common Issue
      • Exports
      • DLC
    • DarkRP_DamageIndicator
      • Config
      • Command
    • DarkRP_KillFeed
      • Config
      • Customization
    • DarkRP_Playerlist
      • Config
    • DarkRP_Chat
      • Config
      • Web Server Setup
    • DarkRP_Screenshot
      • Config
      • Web Server Setup
    • DarkRP_Encrypt
Powered by GitBook
On this page
  1. SCRIPTS
  2. DarkRP_Playerlist

Config

local Scoreboard = SCB.New()
local DisplayType = {
	NUMBER_ONLY = 0,
	ICON = 1,
	NONE = 2
}
local RightIconType = {
	NONE = 0,
	INACTIVE_HEADSET = 48,
	MUTED_HEADSET = 49,
	ACTIVE_HEADSET = 47,
	RANK_FREEMODE = 65,
	KICK = 64,
	LOBBY_DRIVER = 79,
	LOBBY_CODRIVER = 80,
	SPECTATOR = 66,
	BOUNTY = 115,
	DEAD = 116,
	DPAD_GANG_CEO = 121,
	DPAD_GANG_BIKER = 122,
	DPAD_DOWN_TARGET = 123
}

---- Scoreboard:Reset() ---Reset default parameter 
---- Scoreboard:GetMaxPages() ---@return integer integer Nax page number
---- Scoreboard:SetPedMugshot(source) ---@param source integer Player server id
---- Scoreboard:UpdateSlot(slotIndex) -- integer
---- Scoreboard:UpdateMugshot(source, slotIndex) -- integer, integer
---- Scoreboard:UpdateScale(clearSlot) -- boolean
---- Scoreboard:IsRowSupposedToShow(row) -- integer
---- Scoreboard:Visible(_visible) -- boolean | nil
---- Scoreboard:Destroy() -- Destroy scoreborad metatale and scaleform
---- Scoreboard.keyBind = 48 -- ~INPUT_HUD_SPECIAL~ https://docs.fivem.net/docs/game-references/controls/
---- 
---- Hold Scoreboard.keyBind to skip scoreborad and open big map

Scoreboard.TopLeftText = "~r~Dark~b~RP"
Scoreboard.TopRightText = "Nearby Players"
Scoreboard.PageRows = 16
Scoreboard.ShowSelf = true
Scoreboard.CanShowOnDie = true
Scoreboard.BigmapSupport = true

Scoreboard.GetRowRightIconType = function(source)
	local player = GetPlayerFromServerId(source)
	local playerPed = GetPlayerPed(player)

	if IsPedDeadOrDying(playerPed, false) then
		return RightIconType.DEAD
	else
		return RightIconType.RANK_FREEMODE
	end
end

Scoreboard.GetRowHeadshotText = function(source)
	local player = GetPlayerFromServerId(source)
	local playerPed = GetPlayerPed(player)

	return ""
end

Scoreboard.GetRowDisplayType = function(source)
	local player = GetPlayerFromServerId(source)
	local playerPed = GetPlayerPed(player)

	return DisplayType.NUMBER_ONLY
end

Scoreboard.GetRowsColor = function(source)
	local player = GetPlayerFromServerId(source)
	local playerPed = GetPlayerPed(player)

	return 116 --https://docs.fivem.net/docs/game-references/hud-colors/
end

Scoreboard.GetRowPlayerName = function(source)
	local player = GetPlayerFromServerId(source)
	local playerPed = GetPlayerPed(player)
	local name = GetPlayerName(player)
	
	if IsPedDeadOrDying(playerPed, false) then
		name = name.." ~r~COMA"
	end
	
	if GetPedDrawableVariation(playerPed, 1) ~= 0 then
		name = "~r~MASK"
	end
	
	return name
end

Scoreboard.GetRowHeadshotTopLeftText = function(source)
	local player = GetPlayerFromServerId(source)
	local playerPed = GetPlayerPed(player)

	return "AAA"
end

Scoreboard.GetRowRightText = function(source)
	local player = GetPlayerFromServerId(source)
	local playerPed = GetPlayerPed(player)

	return "BBB"
end

Scoreboard.GetRowCrewLabelText = function(source)
	local player = GetPlayerFromServerId(source)
	local playerPed = GetPlayerPed(player)

	return "___CCCCC"
end

Scoreboard.GetRowXP = function(source)
	local player = GetPlayerFromServerId(source)
	local playerPed = GetPlayerPed(player)

	if IsPedDeadOrDying(playerPed, false) then
		return ""
	else
		if GetResourceState("DarkRP_XP") == "started" then -- DarkRP_XP request.
			return (Player(source).state.PlayerXP or 1)
		else
			return "DDD"
		end
	end
end

RegisterCommand('+z_scoreborad', function()
	if not IsPauseMenuActive() then
		Scoreboard:Show()
	end
end, false)
RegisterCommand('-z_scoreborad', function()
end, false)
RegisterKeyMapping('+z_scoreborad', 'Z Scoreborad', 'keyboard', "Z")

RegisterCommand('+z_scoreborad_xbox', function()
	if not IsPauseMenuActive() then
		Scoreboard:Show()
	end
end, false)
RegisterCommand('-z_scoreborad_xbox', function()
end, false)
RegisterKeyMapping('+z_scoreborad_xbox', 'Z Scoreborad Xbox', 'PAD_ANALOGBUTTON', 'LDOWN_INDEX')

Last updated 9 months ago