Skip to content
Open
Show file tree
Hide file tree
Changes from 7 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
2 changes: 1 addition & 1 deletion html/index.css

Large diffs are not rendered by default.

24 changes: 18 additions & 6 deletions html/index.js

Large diffs are not rendered by default.

19 changes: 15 additions & 4 deletions server/misc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,23 @@ RegisterNetEvent('ps-adminmenu:server:Revive', function(data, selectedData)
local data = CheckDataFromKey(data)
if not data or not CheckPerms(source, data.perms) then return end
local player = selectedData["Player"].value

TriggerClientEvent('hospital:client:Revive', player)
if GetResourceState('qbx_medical') == 'started' then
exports.qbx_medical:Revive(player)
else
TriggerClientEvent('hospital:client:Revive', player)
end
end)

-- Revive All
RegisterNetEvent('ps-adminmenu:server:ReviveAll', function(data)
local data = CheckDataFromKey(data)
if not data or not CheckPerms(source, data.perms) then return end

TriggerClientEvent('hospital:client:Revive', -1)
if GetResourceState('qbx_medical') == 'started' then
exports.qbx_medical:Revive(-1)
else
TriggerClientEvent('hospital:client:Revive', -1)
end
end)

-- Revive Radius
Expand All @@ -105,7 +112,11 @@ RegisterNetEvent('ps-adminmenu:server:ReviveRadius', function(data)
local dist = #(pos - targetPos)

if dist < 15.0 then
TriggerClientEvent("hospital:client:Revive", v)
if GetResourceState('qbx_medical') == 'started' then
exports.qbx_medical:Revive(v)
else
TriggerClientEvent('hospital:client:Revive', v)
end
end
end
end)
Expand Down
9 changes: 6 additions & 3 deletions server/players.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,27 @@ local function getPlayers()
for k, v in pairs(GetPlayers) do
local playerData = v.PlayerData
local vehicles = getVehicles(playerData.citizenid)

local coords = GetEntityCoords(GetPlayerPed(playerData.source))
local pos = { x = coords.x, y = coords.y, z = coords.z }

players[#players + 1] = {
id = k,
name = playerData.charinfo.firstname .. ' ' .. playerData.charinfo.lastname,
cid = playerData.citizenid,
license = QBCore.Functions.GetIdentifier(k, 'license'),
discord = QBCore.Functions.GetIdentifier(k, 'discord'),
steam = QBCore.Functions.GetIdentifier(k, 'steam'),
fivem = QBCore.Functions.GetIdentifier(k, 'fivem'),
job = playerData.job.label,
grade = playerData.job.grade.level,
dob = playerData.charinfo.birthdate,
cash = playerData.money.cash,
bank = playerData.money.bank,
phone = playerData.charinfo.phone,
vehicles = vehicles
vehicles = vehicles,
pos = pos
}
end

table.sort(players, function(a, b) return a.id < b.id end)

return players
Expand Down
4 changes: 4 additions & 0 deletions ui/src/layout/Main.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import StaffChat from '@pages/Chat/Chat.svelte'
import Players from '@pages/Players/Players.svelte'
import Commands from '@pages/Commands/Commands.svelte'
import Livemap from '@pages/Livemap/Livemap.svelte'

</script>

<div
Expand All @@ -25,6 +27,8 @@
<Players />
{:else if $ACTIVE_PAGE == 'Commands'}
<Commands />
{:else if $ACTIVE_PAGE == 'Livemap'}
<Livemap />
{/if}
</div>
</div>
1 change: 1 addition & 0 deletions ui/src/layout/Sidebar/Sidebar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
{ value: 'Server', icon: 'fas fa-server' },
{ value: 'Commands', icon: 'fas fa-slash' },
{ value: 'Actions', icon: 'fas fa-wand-magic-sparkles' },
{ value: 'Livemap', icon: 'fas fa-map-location-dot' },
]
</script>

Expand Down
Loading