Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added send to swim command #222

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions client/events.lua
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,10 @@ RegisterNetEvent('qb-admin:client:maxmodVehicle', function()
local vehicle = GetVehiclePedIsIn(PlayerPedId())
PerformanceUpgradeVehicle(vehicle)
end)

RegisterNetEvent('qb-admin:client:sendtoswim',function(id,reason)
local ped = PlayerPedId(id)
local coords = vector3(-4915.85, -3057.73, -0.94)
QBCore.Functions.Notify(reason, 'error')
SetEntityCoords(ped, coords.x, coords.y, coords.z)
end)
1 change: 1 addition & 0 deletions locales/en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ local Translations = {
report_toggle = 'Toggle Incoming Reports (Admin Only)',
kick_all = 'Kick all players',
ammo_amount_set = 'Set Your Ammo Amount (Admin Only)',
sendtoswim = "Send player to swimming (Admin Only)",
}
}

Expand Down
6 changes: 6 additions & 0 deletions server/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,12 @@ QBCore.Commands.Add('heading', 'Copy heading to clipboard (Admin only)', {}, fal
TriggerClientEvent('qb-admin:client:copyToClipboard', src, 'heading')
end, 'admin')

QBCore.Commands.Add('sendtoswim', Lang:t('commands.sendtoswim'), { { name = 'id', help = 'Player id' }, { name = 'Reason', help = 'Reason to send to swim' }, }, true, function(_, args)
local playerid = tonumber(args[1])
local reason = table.concat(args, " ",2)
TriggerClientEvent('qb-admin:client:sendtoswim', playerid,playerid, reason)
end, 'admin')

CreateThread(function()
while true do
local tempPlayers = {}
Expand Down
Loading