You may add to your tutorial, that for some labels, an additional text has to be requested & loaded.
For example, if I want to use any label from the mod_mnu.gxt2 I have to request it.
But before I check if the slot is free and if the additional text isn’t already loaded in the slot.
local CAT = 'mod_mnu'
local CurrentSlot = 0
while HasAdditionalTextLoaded(CurrentSlot) and not HasThisAdditionalTextLoaded(CAT, CurrentSlot) do
Citizen.Wait(0)
CurrentSlot = CurrentSlot + 1
end
If my additional text isn’t already loaded into this slot, I will clear it and load my additional text into it.
if not HasThisAdditionalTextLoaded(CAT, CurrentSlot) then
ClearAdditionalText(CurrentSlot, true)
RequestAdditionalText(CAT, CurrentSlot)
while not HasThisAdditionalTextLoaded(CAT, CurrentSlot) do
Citizen.Wait(0)
end
end
Thats it, now I am able to use the labels inside mod_mnu.gxt2
I’ve turned the original post into a Wiki so, you should be able to just edit that and add any new labels you find or, any more information (and, others can clarify stuff if they wish).
Very nice tutorial thank you!
People might also be interested in this list containing all labels in the game as of the latest version (1365), compiled by UnknownModder from the GTAF. I find it easier to look for a certain label with a simple ctrl+F in that document.
sorry for asking this… if i release a script with random collisions added as labels_texts… do other people read it correctly? or it is only something for me?
I am having a problem with these kind of labels. It is not UTF-8 and missing some letters in my language. Is there a way to modify this? The missing letters are from Windows-1257 or ISO/IEC 8859-13
Question. Not sure if this is an issue on my end. But I am using RP Revive in my server. I am trying to replace the old notification with this, but I am running into an issue.
When I die in game, I hear the tone of the label popping up, but nothing shows on screen.
Here’s my current code:
while true do
Citizen.Wait(0)
ped = GetPlayerPed(-1)
if IsEntityDead(ped) then
-- ShowInfoRevive('~r~You Are Dead ~w~Please wait ~y~'.. tostring(reviveWait) ..' Seconds ~w~ before choosing an action')
SetPlayerInvincible(ped, true)
SetEntityHealth(ped, 1)
ShowInfoRevive()
if ( IsControlJustReleased( 0, 38 ) or IsDisabledControlJustReleased( 0, 38 ) ) and GetLastInputMethod( 0 ) then
revivePed(ped)
elseif ( IsControlJustReleased( 0, 65 ) or IsDisabledControlJustReleased( 0, 65 ) ) and GetLastInputMethod( 0 ) then
local coords = spawnPoints[math.random(1,#spawnPoints)]
respawnPed(ped, coords)
allowRespawn = false
respawnCount = respawnCount + 1
math.randomseed( playerIndex * respawnCount )
end
end
end
end)
function revivePed(ped)
local playerPos = GetEntityCoords(ped, true)
NetworkResurrectLocalPlayer(playerPos, true, true, false)
SetPlayerInvincible(ped, false)
ClearPedBloodDamage(ped)
end
function ShowInfoRevive()
BeginTextCommandDisplayHelp("STRING")
AddTextComponentSubstringPlayerName("~r~You have died! ~w~Use ~INPUT_PICKUP~ to revive.")
AddTextComponentFloat(100.3948, 2)
EndTextCommandDisplayHelp(0, 0, 1, -1)
end