mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-08-29 17:28:56 +00:00
Merge Dev (#794)
* [Update] Stuff and Things - Fix Exploit - Update doors on teleport so they don't get stuck (requires my doorlock PR that creates a updateDoors() export - Support for heading with TeleportToCoords event - Support for teleporting to location name with /tp and a default file with locations to use - Remove 'QBCore:Server:AddItem' event (requires PR to other resources that use it) - Support for an array of items that do the same thing with QBCore.Functions.CreateUsableItem - Player exists check before removing or adding permission - Trigger OnPlayerUnload as a server side event too - Player.Functions.GetMetaData function - Added reason to money remove logs - Set dirt level to 0 on /car vehicles * Export to Event * Deprecate instead of remove? * Player+License verification fix * Update events.lua * Export change for qb-management * [Hotfix] Errors after Merge * [Change] src to source * Prevent people using /me to troll This prevents people using that /me troll with the huge font size and different colors. * Remove DoorUpdate event * Update client/events.lua Co-authored-by: BerkieBb <82737367+BerkieBb@users.noreply.github.com> * Update server/functions.lua Co-authored-by: BerkieBb <82737367+BerkieBb@users.noreply.github.com> * Adjustments for BB * Linting * fix(server/functions): use indexed variables Co-authored-by: David Malchin <malchin459@gmail.com> * chore(server/events): remove unnecessary _ Co-authored-by: David Malchin <malchin459@gmail.com> * chore(server/events): remove unnecessary _'s Co-authored-by: David Malchin <malchin459@gmail.com> * chore(server/events): language Co-authored-by: David Malchin <malchin459@gmail.com> * chore(server/events): language Co-authored-by: David Malchin <malchin459@gmail.com> * chore(server/events): language Co-authored-by: David Malchin <malchin459@gmail.com> * chore(server/events): language Co-authored-by: David Malchin <malchin459@gmail.com> * chore(server/player): indentation Co-authored-by: David Malchin <malchin459@gmail.com> * [Chore] Remove Money Removed repetitive code that made zero sense * Update en.lua * Update player.lua * Update player.lua * Update functions.lua Co-authored-by: ItsANoBrainer <itsanobrainergg@protonmail.com> Co-authored-by: Scullyy <51968381+Scullyy@users.noreply.github.com> Co-authored-by: Idris Dev <IdrisDose@users.noreply.github.com> Co-authored-by: Idris <idrisdev@gmail.com> Co-authored-by: BerkieBb <82737367+BerkieBb@users.noreply.github.com> Co-authored-by: David Malchin <malchin459@gmail.com> Co-authored-by: Chris Usiak <christopher.usiak@oakland.k12.mi.us>
This commit is contained in:
+15
-7
@@ -81,15 +81,23 @@ function QBCore.Commands.Refresh(source)
|
||||
end
|
||||
|
||||
-- Teleport
|
||||
|
||||
QBCore.Commands.Add('tp', 'TP To Player or Coords (Admin Only)', { { name = 'id/x', help = 'ID of player or X position' }, { name = 'y', help = 'Y position' }, { name = 'z', help = 'Z position' } }, false, function(source, args)
|
||||
QBCore.Commands.Add('tp', 'TP To Location/Player/Coords (Admin Only)', { { name = 'location/id/x', help = 'location name, ID of player, or X position' }, { name = 'y', help = 'Y position' }, { name = 'z', help = 'Z position' } }, false, function(source, args)
|
||||
if args[1] and not args[2] and not args[3] then
|
||||
local target = GetPlayerPed(tonumber(args[1]))
|
||||
if target ~= 0 then
|
||||
local coords = GetEntityCoords(target)
|
||||
TriggerClientEvent('QBCore:Command:TeleportToPlayer', source, coords)
|
||||
if tonumber(args[1]) then
|
||||
local target = GetPlayerPed(tonumber(args[1]))
|
||||
if target ~= 0 then
|
||||
local coords = GetEntityCoords(target)
|
||||
TriggerClientEvent('QBCore:Command:TeleportToPlayer', source, coords)
|
||||
else
|
||||
TriggerClientEvent('QBCore:Notify', source, Lang:t('error.not_online'), 'error')
|
||||
end
|
||||
else
|
||||
TriggerClientEvent('QBCore:Notify', source, Lang:t('error.not_online'), 'error')
|
||||
local location = QBShared.Locations[args[1]]
|
||||
if location then
|
||||
TriggerClientEvent('QBCore:Command:TeleportToCoords', source, location.x, location.y, location.z, location.w)
|
||||
else
|
||||
TriggerClientEvent('QBCore:Notify', source, Lang:t('error.location_not_exist'), 'error')
|
||||
end
|
||||
end
|
||||
else
|
||||
if args[1] and args[2] and args[3] then
|
||||
|
||||
Reference in New Issue
Block a user