[REQUEST] MyID - Show ID using chat command

Hello guys! I’m here with another simple script suggestion!
I know that many of you can think that this resource may be unnecessary but anywas, here it is:

My suggestion this time is a script called “MyID” that would work like that:
When the player write on the chat /myid, it would send a notification throught pNotify or something simillar saying what is the player ID

You may say that I can turn on/off the users ID’s above their heads but I think that this screw up with the RP a litte bit. In the other hand, the user ID may be required for something so it’s important to have a script like this one.

What I’ve tried was creating a script simpler than this one (yeah, I suck at programming) that sends a chat message with the user ID but that did not work out. Here is the code that I tried to use for that:

AddEventHandler('chatMessage', function(source, name, msg)
	sm = stringsplit(msg, " ");
	user_id = GetPlayerFromServerId(source)
	if sm[1]:lower() == "/myid" or sm[1]:lower() == "/id" then
		CancelEvent()
		TriggerClientEvent('chatMessage', -1, user_id, { 255, 140, 0 })
	end
end)

function stringsplit(inputstr, sep)
    if sep == nil then
        sep = "%s"
    end
    local t={} ; i=1
    for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
        t[i] = str
        i = i + 1
    end
    return t
end

Fell free to do a working version of the one that sends the ID in the chat or the one (that, in my opinion, is better) that sends the ID to the player throught pNotify.

If you want to go even further, here is another suggestion to improve this script:
-A command that only users with a vRP permission can use to show other players ID’ s (you can forget about the part of the vRP permission if it’s too hard, it’ s not that important). The command would be something like /ID <userName> or /ID <userIdentity>. If you use vRP, there are infinite possibilities to get other users ID’ s with this command, like using the phone number, in-game name, etc.

If someone acctually do this script, you, obviously, have full credits but I would appreciate a reference for me at the README.txt.

Thanks for reading and hope that someone acctualy do this script!

GetPlayerFromServerId gets the player from the (id) source so just send source variable and you have the player id