I need a command that can be used by admins only, that can teleport a specific player to a specific location using their ID number.
(Adding the ability to freeze the player when they get there would be a bonus but I would be more than happy with just the teleporter.)
example:
/aj 1 (Admin Jail + PlayerID)
This would teleport the targeted player to…
vector3(1651.1, 2570.52, 45.56)
This is a txadmin server using the latest qbcore framework.
The purpose of this command would be to give admins the ability to send players to a closed box for an admin to deal with them properly and without external hassle from other players.
I have a command in qbcore for the police to use for RP scenarios for them to send players to prison.
I am looking for the same thing for the admins only.
I spent 4 hours in GTAV Natives trying to figure it out on my own with zero success, please don’t direct me there.
if you can make it you will be credited fully for it, and free to distribute it elsewhere if you feel (many others are looking for this sort of command.)
Thank you in advance!
-------------------------------------------------------------------------------
This issue was solved by the below user, please check out their cfx profile and give them a follow!
The server native RegisterCommand takes the arguments: command name, command function, authorized
You can create an admin only command (admin based off ace perms) using
RegisterCommand('name', function(source, args, raw)
local src = source
local trg = args[1]
local trgPed = GetPlayerPed(trg)
if trgPed and DoesEntityExist(trgPed) then
SetEntityCoords(trgPed, yourX, yourY, yourZ)
FreezeEntityPosition(trgPed, true)
end
end, true)
where “, true” dictates the command must be run by an authorized user only.
Thank you for your speedy reply!
Could there be something missing from this? Or something that I am missing?
I have tried what you sent here but it isn’t doing anything, and it isn’t adding the command to the chat suggestion box.
Things I edited include…
-Added this script into a new resource folder, and named the script file ‘main.lua’.
-Added an ‘fxmanifest.lua’ file into the resource folder.
-Added the desired coordinates into the script.
-Changed the name of command from ‘name’ to ‘timeop’
-Added ace permission in my ‘server.cfg’
(txAdmin and FiveM console says that the resource starts, but it doesn’t seem to do anything)
(I added a copy of the entire resource folder here.)
TestTP.zip (753 Bytes)
Put the above command into an already running server file and test it please, report back findings from that. Also add prints
RegisterCommand('name', function(source, args, raw)
local src = source
local trg = args[1]
local trgPed = GetPlayerPed(trg)
print(src, trg, trgPed)
if trgPed and DoesEntityExist(trgPed) then
SetEntityCoords(trgPed, yourX, yourY, yourZ)
FreezeEntityPosition(trgPed, true)
end
print('finished executing command name')
end, true)
CFX is currently down but my server is still running so I attempted a test.
(Until CFX is back up and running I can’t add the ace permission back into my server.cfg file for a server restart, I removed the ace last night to keep things tidy so I can track my steps “that was a mistake in this case”)
First try without ace permissions - The console shot out an error/warning stating:
" |cmd| Command timeop is disabled in production mode. See https://aka.cfx.re/prod-console for further information. ’
(This is likely due to the missing server.cfg admin ace permission.)
So I tried again with ‘true’, set to ‘false’ (command restriction disabled), and the console printed:
’ |script:CRAYZ33T-ServerBlips| 0 2 0 ’
’ |script:CRAYZ33T-ServerBlips| finished executing command name ’
(UserID: 2 is my character in this case - I attempted to teleport myself using the script as no one can get into the server right now, but this failed, I don’t think I can TP myself with this command but that is fine)
I will have to wait for CFX to get back online so I can set the ace permission again and try this with a secondary player to investigate further.
I wanted to take this time to thank you for your time here so far, I really do appreciate this, and I am sure others who find this thread later will appreciate this too!
Tried again…
-Changed the command ‘name’ on first line.
-Readded the ace permission for the changed command name to server.cfg.
-Added the desired target location.
-Hard restarted server.
-Isn’t doing anything other than reporting to console the below entries.
“0 2 0”
“finished executing command name”.
I have tried this in both client.lua, config.lua and server.lua (qb-smallresources) as it is technically a server-sided script.
If you can… could you build this resource and release it?
---------------------------------------------
RegisterCommand(‘timeop’, function(source, args, raw)
local src = source
local trg = args[1]
local trgPed = GetPlayerPed(trg)
print(src, trg, trgPed)
if trgPed and DoesEntityExist(trgPed) then
SetEntityCoords(trgPed, 1651.1, 2570.52, 45.56)
FreezeEntityPosition(trgPed, true)
end
print(‘finished executing command name’)
end, true)
Swapped to release version of the game from Beta, pasted the command into my debug server file, started my server and loaded in, entered “/name 1” in my client chat box, got the print and teleported to nowhere because the command calls yourX, etc which is nothing.
Your framework should handle ace perms as far as I’m aware qb didn’t remove that functionality.
I changed ’ yourX, yourY, yourZ ’
to
1651.1, 2570.52, 45.56 though. That is so strange.
I couldn’t create a release as it’s too minimal.
admincommand.zip (649 Bytes)
Thank you for this file…
There is clearly something wrong with my server it seems.
It still isn’t working for me.
Maybe a gamebuild issue or something.
I am using the newest gamebuild 2944.
I have no idea what else it could be…
I put the command ace in my cfg file (add_ace group.admin command.name).
I will try one more time to backtrack to an earlier build though, can you tell me what one you are on? Which is the most stable?
My FXServer artifacts are 5848, gamebuild 2699. The artifacts version might be the biggest difference, as mine are quite old, but it is still the latest recommended.
Have you tried with the command name “name”?
Yeah, I tried with ‘name’ with the ace perms active in the server.cfg file (I only changed the vector3 to my desired coords).
I tried both coordinate options…
vector3(1651.1, 2570.52, 45.56)
as well as
1651.1, 2570.52, 45.56
I even removed all the admin perms from my wife’s account to see if maybe the script couldn’t send admins. (both of us have admin perms on QB and Tx)
I have no idea what the issue is, I believe you that your script works, but not sure why it doesn’t work on my server.

Are you certain you are sending the correct server id? Can you make a video showing you trying to call the command, and show your server id while doing so.
Yoooooo! It worked!
UID used. (overhead number)
I have no idea what the issue was yesterday, but it works now!
(The unfreeze command also works)
YOU ARE A GOD! Thank You SOO Much!
This is epic! Thank You Thank You Thank You!
Did you write this script yourself? Very impressive if so!
You should add a new post and add it here on cfx as a new resource release
Unless you would like me to do it for you, I can credit it to your CFX profile, Tebex Store, YouTube Channel, etc, or all of the above.
Do you have a YouTube or Tebex Store? I’d like to follow them if so.
Both of the commands you sent, work BEAUTIFULLY…
BUT, I have one more question/challenge for you if you are up to it…
I really do applaud your knowledge, helpfulness, patience as well as your foresight, because I hadn’t even thought far enough ahead to consider that I would need to be able to cancel the “freeze player portion”, and you made that happen without even being asked!
Bravo!
My question/challenge is…
Do you know how to add in suggestions for the chat box like shown below? (by adding onto your commands script)

My ultimate view for this scripting project is to incorporate multiple projects from multiple creators into one cohesive “AdminTimeout” script. The purpose of this is to trap trolls into a closed area where they have no control and are separated from the rest of the server including prisoners of Bollingbroke Prison.
- I have created a “PolyZone”… complete with “Notifications” for when the targeted player arrives into the designated zone, using the vectors from your command script…
- I have your incorporated your dual-command script (admincommands.zip) into my PolyZone script… (Which is God-Like on it’s own, and WELL above expectation might I add)
I wanted to finalize this entire project by adding in chat suggestions for both of the commands that can be run using your server command script.
NOTE: There is an alternate script of this nature called “AdminJail” that requires the player to complete tasks to be released from the prison yard… That is fun and all, but I want a more serious option to deal with trollers, where they have to speak privately with an admin before being released into the city again. I have the “AdminJail” script in my server, but for some players it just doesn’t work well enough.
I did write the resource myself. As stated previously, that specific set of code is not enough to be pushed as a release on the CFX forums, even if it does by some miracle pass all release rules, I personally feel it is not enough code to validate a release, and the code needs further development to be 100% functional. I appreciate your enthusiasm in it’s ability to perform the requested feature.
As for the suggestions, if you take a note from either main framework used in FiveM, ESX and QBCore, you will notice that they add suggestions client side upon login, through the chat resource using
TriggerEvent('chat:addSuggestion', ('/%s'):format(name), command.suggestion.help, command.suggestion.arguments). For the admincommand resource to apply a command suggestion you will need to listen for some player connection event, something written directly into a client side file in the resource, or some framework connection event, and then have the client call something like
TriggerEvent('chat:addSuggestion', ('/%s'):format(commandNameSentFromServer), 'Send player to lockdown', {{name = 'id', help = 'Player Server ID'}})