This is my first attempt at a script for FiveM and may be my last since I found it frustrating lol.
I made this script a while back for my server, Paradox Gaming, and I made it because I have yet to come across a simple and clean script that introduces an ID that people can provide to officers or whoever with enough details that makes it seem like an actual ID.
Just type “/giveid” (without the quotations) to the closest player and it will provide the ID to them. It will tell you who you gave your ID to to make it easier to check if you gave it to the correct person. Basic information of that player will be pulled from esx_identity to create that ID. When you are in a vehicle, you can provide that ID but you cannot be outside of a vehicle and hand it to someone in a vehicle. You can give your ID if both are not in a vehicle.
Dependencies: es_extended, esx_identity
Credits: Myself, @Smallo, and a little bit of @Jaymo
P.S. My gaming community discord is not a place to get help for the script. Just DM me and I’ll try to help if there’s any bugs. I will not help with common sense things.
Seems good, but you could add a menu, this would make it a lot easier for people that are new on a server and has no idea from commands.
Very nice design, I may use it
I’m very new to the scripting side of FiveM. So I definitely want all the feedback and suggestions to improve on it. I should try to add that in and see if I can figure it out on my own before I cry lol
A menu just for this would be a waste of resources.
I think it’s way better to do a Event Handler, that you can let ppl integrate up against, makes way more sence Then creating a new menu for it to be honest.
What could be done tho is using the build in ESX method for Getting closest player.
But dont think it would change performance a lot tho, but ye.
local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
if closestPlayer ~= -1 and closestDistance <= 3.0 then
--SomeCode
else
ESX.ShowNotification('No Players Nearby')
end
And this is minor not sure what the performance difference is, maybe someone knows that?
Well, if you’re still trying to figure out how a menu works you could watch this tutorial, I think it’s good enough to learn about it:
And like bzndk says you don’t need to waste your time on something, because someone said that it could be a good feature. You are the developer, so do what you want to do
I like all the suggestions. Definitely something I can always go into and play around with. Again, this is new for me so quick updates are not foreseeable just yet lol.
Thats because, if you take 10 seconds to look at the code, you’ll see its searching for an ‘M’ or ‘F’ probably in your database they are lower case, so adjust accordingly.
Where would I change the location of the notification? I would like to have it moved up a little from the bottom left, However cant find anything in the code.