[REQ]Names displayed

How would one go about making chat names reflect a players RP name in the DB displaying in chat as opposed to their steam name? I’d prefer to mask people’s steam names entirely if possible.

1 Like

You can modify “Player Blips and Above Head Display” from [Release] Scammer's Script Collection (09/03/17) to make your script (if the author agree)

I’m actually trying to alter the chat name, not so much the display name.

1 Like

Ohhh sorry :man_facepalming:
You can modify chat script then.

I think the better solution for this is to broadcast to all client the complete message and not only the content message

Complete message => John Doe : Hello World !
Content message => Hello World !

I guess what is asked is how to get the playername as it is set in FiveM settings.

I was wondering that too, so you can force users to authenticate with Steam but you allow them to show the name they want ingame :slight_smile:

Atm, we can’t use this system (if I’m wrong, please notice me)

That’s what I’ve heard, the “solution” I know is to start the game with steam client closed to see FiveM names ingame.

Oh I see, maybe the setting is use when you’re not connect to Steam :confused:

But if @Miss_Behavin use Steam authentification, he (or she, idk ^^) should store player names in database and replace all GetPlayerName by theses stored player names

Yes but since you cannot natively get user custom names, you’ll have to ask the user to input its name with a form at first connection in order to store it :slightly_smiling_face:

It the only way I think :confused:

1 Like

You genuinely have a hard time figuring out if I’m a man or woman? Really? That’s your concern?

What happens now:

steamname: Hi everyone

What I want

databasename: Hi everyone

Hum why did you say that :confused: I love when ppl become friendly like that when we are trying to help them :roll_eyes:
And yes we undestand what you want

replace in chat resource

1 Like

@Miss_Behavin were you ever able to resolve this? I am currently trying to do the same thing and I have been at it for hours lol.

1 Like

yes @UpTime

function getIdentity(source)
    local identifier = GetPlayerIdentifiers(source)[1]
    local result = MySQL.Sync.fetchAll("SELECT firstname, lastname, sex, dateofbirth, height FROM characters WHERE identifier = @identifier", {
			['@identifier'] = identifier
    })
  if result[1] ~= nil then
    local user = result[1]
  
  return {
    firstname = user['firstname'],
    lastname = user['lastname'],
    dateofbirth = user['dateofbirth'],
    sex = user['sex'],
    height = user['height'],
    name = user['name']
  }
  else
    return nil
    end
end

AddEventHandler('chatMessage', function(source, name, msg)
  if string.sub(message,1,string.len("/"))=="/" then
    CancelEvent()
    TriggerClientEvent('chatMessage', -1, " " .. name, { 255, 255, 255 }, string.sub(msg,5))
  end
end)

Awesome! And did you put this in the chat resource or somewhere else? I’ll be sure to try this when I get home @Miss_Behavin

So where exactly do I put this?

Yes Where do you put this Script? Specifically which file/folder/path client or server?

yeah smart behavin where did u put that lines ?

where do u place that

1 Like

I want to change the name on the game character from Steam nickname to in-game nickname. What should I do?