[Release] Change Pause Menu Name


#23

Are you retarded?

You just created a string with the native written into it…

Use this:

AddTextEntry('FE_THDR_GTAO', '~b~Daylight~r~RP | ' .. GetPlayerServerId(PlayerId()))

#24

Lad, Not everyone knows lua like you might lol. no need to call me retarded


#25

I mean, it should be pretty obvious that you can’t put a Native inside a string and expect it to work…


#26

Not to someone who doesn’t really understand lua lmao, still enough to get called retarded on a forum but ok sir o7


#27

Well, let’s keep this topic on-topic. :slight_smile:


#28

hey i want it to be like this but i cant get is to work how it want it to

here is a image of how i want it to be

Please help me


#29

If you would read like 5 posts above yours, you will find


#30

that is just the id not the name


it works whit this code here

  AddTextEntry('FE_THDR_GTAO', '~y~TGA Roleplay ~m~| ~b~ Discord~m~:~b~  x7u54NH ~m~| ~r~  User ~m~ ' .. (GetPlayerName(i))) 


and it works whit this code here

  AddTextEntry('FE_THDR_GTAO', '~y~TGA Roleplay ~m~| ~b~ Discord~m~:~b~  x7u54NH ~m~| ~r~  User ~m~ ' .. GetPlayerServerId(PlayerId()))

But how can i get both to work at the same time?


i want it to be like this but i cant get it to work


#31

Hi,

Test with :

  AddTextEntry('FE_THDR_GTAO', '~y~TGA Roleplay ~m~| ~b~ Discord~m~:~b~  x7u54NH ~m~| ~r~  User ~m~ ' .. GetPlayerServerId(PlayerId()) .. 'ID :' .. (GetPlayerName(i))) 

#32

yeah thanks it work now but it looks a bit fucked up there whit the id

EDIT
i fixed it thanks for the help m8


#33
AddTextEntry('FE_THDR_GTAO', '~y~TGA Roleplay ~m~| ~b~Discord~m~: ~b~x7u54NH~m~ | ~r~ID~m~ ' .. GetPlayerServerId(PlayerId()) .. ' ~m~| ~r~Name: ~b~' .. (GetPlayerName(i))) 

#34

ahh okay thanks i had fixed it but thanks for the help


#35

So, I don’t know why but if you look at image 1, you see that it works. But when the script has been on for a while, it changes to the way you see in image 2. To fix it I have to restart the script, can you please help me?


Image 1


Image 2


Config

function AddTextEntry(key, value)
	Citizen.InvokeNative(GetHashKey("ADD_TEXT_ENTRY"), key, value)
end

Citizen.CreateThread(function()
AddTextEntry('FE_THDR_GTAO', '~y~TGA Roleplay ~t~| ~g~Discord: x7u54NH~t~ | ~b~ID: ' .. GetPlayerServerId(PlayerId()) .. ' ~t~| ~b~Name: ~b~' .. (GetPlayerName(i))) 
end)

#36

Wouldn’t this work?

AddTextEntry('FE_THDR_GTAO', '~y~TGA Roleplay ~t~| ~g~Discord: x7u54NH~t~ | ~b~ID: ' .. GetPlayerServerId(PlayerId()) .. ' ~t~| ~b~Name: ~b~' .. GetPlayerName(PlayerId())) 

#37

im gonna try that thanks for the help


#38

i have the same problem

Edit:

Mabye if i add so the script updates so the script holds the player names uptodate for example it checks for updates evry 5 or 10 min idk

idk how to add it thoe but i saw other scripts has it like that


#39

Try this should work fine

function SetTitle(key, value)
	local name = GetPlayerName(PlayerId())
	local id = GetPlayerServerId(PlayerId())
	Citizen.InvokeNative(GetHashKey("ADD_TEXT_ENTRY"), key, value)
	Citizen.InvokeNative(GetHashKey("ADD_TEXT_ENTRY"), 'FE_THDR_GTAO', "~y~TGA Roleplay ~c~| ~g~Discord: x7u54NH ~c~| ~b~ID: " .. id .. " ~c~| ~w~Name: ~r~" .. name)
end

Citizen.CreateThread(function()
	SetData()
	while true do
		Citizen.Wait(2500)
		SetTitle()
	end
end)

#40

Thanks im gonna test that


EDIT:
That did not work


Edit2:

So i changed the code and now it works but now i need to wait if i have the same problem or not

here is the code that i use now

function AddTextEntry(key, value)
	Citizen.InvokeNative(GetHashKey("ADD_TEXT_ENTRY"), key, value)
end

Citizen.CreateThread(function()
AddTextEntry('FE_THDR_GTAO', '~y~TGA Roleplay ~t~| ~g~Discord: x7u54NH~t~ | ~b~ID: ' .. GetPlayerServerId(PlayerId()) .. ' ~t~| ~b~Name: ~b~' .. GetPlayerName(PlayerId()))
end)

Citizen.CreateThread(function()
	SetData()
	while true do
		Citizen.Wait(2500)
		SetTitle()
	end
end)

Edit3:

now i have the same problem


#41

Works fine for me, on both my development and gamemode server.

img%202


#42

it works for me allso but when it has take some time it gets fucked