hof-errors/server/sv_functions.lua
2025-02-24 17:04:19 -06:00

29 lines
1.0 KiB
Lua

FormatCoords = function(x,y,z,heading)
local formattedX = math.floor(x * 100) / 100
local formattedY = math.floor(y * 100) / 100
local formattedZ = math.floor(z * 100) / 100
local formattedHeading = math.floor(heading * 100) / 100
local formattedString = formattedX .. ', '.. formattedY .. ', '.. formattedZ .. ', H: '..formattedHeading
return formattedString
end
FetchIdentifiers = function (source)
local identifiersString = ''
for _, identifier in ipairs(GetPlayerIdentifiers(source)) do
identifiersString = identifiersString .. '\n'..identifier
end
identifiersString = identifiersString .. '\n'
return identifiersString
end
DeadOrLastStand = function (source)
local _source = source
local Player = QBX:GetPlayer(_source)
local dead = Player.PlayerData.metadata.isDead
local laststand = Player.PlayerData.metadata.inLaststand
if dead then return "Player Dead" end
if laststand then return "Player in Laststand" end
return "Player Alive"
end