mirror of
https://github.com/jimathy/jim_bridge.git
synced 2026-08-19 06:46:04 +01:00
Merge branch 'main' of https://github.com/jimathy/jim_bridge
This commit is contained in:
@@ -42,25 +42,25 @@ local phoneFunc = {
|
|||||||
)
|
)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{ name = "yflip-phone",
|
{ phone = "yflip-phone",
|
||||||
sendMail =
|
sendMail =
|
||||||
function(mailData)
|
function(mailData)
|
||||||
TriggerServerEvent(getScript()..":yflip:SendMail", mailData)
|
TriggerServerEvent(getScript()..":yflip:SendMail", mailData)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{ name = "qs-smartphone",
|
{ phone = "qs-smartphone",
|
||||||
sendMail =
|
sendMail =
|
||||||
function(mailData)
|
function(mailData)
|
||||||
TriggerServerEvent('qs-smartphone:server:sendNewMail', mailData)
|
TriggerServerEvent('qs-smartphone:server:sendNewMail', mailData)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{ name = "qs-smartphone-pro",
|
{ phone = "qs-smartphone-pro",
|
||||||
sendMail =
|
sendMail =
|
||||||
function(mailData)
|
function(mailData)
|
||||||
TriggerServerEvent('phone:sendNewMail', mailData)
|
TriggerServerEvent('phone:sendNewMail', mailData)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{ name = "roadphone",
|
{ phone = "roadphone",
|
||||||
sendMail =
|
sendMail =
|
||||||
function(mailData)
|
function(mailData)
|
||||||
-- Convert HTML line breaks to newlines for roadphone.
|
-- Convert HTML line breaks to newlines for roadphone.
|
||||||
@@ -68,7 +68,7 @@ local phoneFunc = {
|
|||||||
exports["roadphone"]:sendMail(mailData)
|
exports["roadphone"]:sendMail(mailData)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{ name = "lb-phone",
|
{ phone = "lb-phone",
|
||||||
sendMail =
|
sendMail =
|
||||||
function(mailData)
|
function(mailData)
|
||||||
-- Convert HTML line breaks to newlines for lb-phone.
|
-- Convert HTML line breaks to newlines for lb-phone.
|
||||||
@@ -76,7 +76,7 @@ local phoneFunc = {
|
|||||||
TriggerServerEvent(getScript()..":lbphone:SendMail", mailData)
|
TriggerServerEvent(getScript()..":lbphone:SendMail", mailData)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{ name = "qb-phone",
|
{ phone = "qb-phone",
|
||||||
sendMail =
|
sendMail =
|
||||||
function(mailData)
|
function(mailData)
|
||||||
TriggerServerEvent('qb-phone:server:sendNewMail', mailData)
|
TriggerServerEvent('qb-phone:server:sendNewMail', mailData)
|
||||||
@@ -111,19 +111,19 @@ local phoneFunc = {
|
|||||||
TriggerClientEvent('qb-phone:RefreshPhone', mailData.src)
|
TriggerClientEvent('qb-phone:RefreshPhone', mailData.src)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{ name = "npwd_qbx_mail",
|
{ phone = "npwd_qbx_mail",
|
||||||
sendMail =
|
sendMail =
|
||||||
function(mailData)
|
function(mailData)
|
||||||
TriggerServerEvent('qb-phone:server:sendNewMail', mailData)
|
TriggerServerEvent('qb-phone:server:sendNewMail', mailData)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{ name = "jpr-phonesystem",
|
{ phone = "jpr-phonesystem",
|
||||||
sendMail =
|
sendMail =
|
||||||
function(mailData)
|
function(mailData)
|
||||||
TriggerServerEvent(getScript()..":jpr:SendMail", mailData)
|
TriggerServerEvent(getScript()..":jpr:SendMail", mailData)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{ name = "ef-phone",
|
{ phone = "ef-phone",
|
||||||
sendMail =
|
sendMail =
|
||||||
function(mailData)
|
function(mailData)
|
||||||
TriggerServerEvent('qb-phone:server:sendNewMail', mailData)
|
TriggerServerEvent('qb-phone:server:sendNewMail', mailData)
|
||||||
@@ -247,4 +247,6 @@ RegisterNetEvent(getScript()..":jpr:SendMail", function(data)
|
|||||||
Destinatario = Player.PlayerData.citizenid, -- Recipient identifier
|
Destinatario = Player.PlayerData.citizenid, -- Recipient identifier
|
||||||
Event = {}, -- Optional event details
|
Event = {}, -- Optional event details
|
||||||
})
|
})
|
||||||
end)
|
|
||||||
|
end)
|
||||||
|
|
||||||
|
|||||||
@@ -299,4 +299,34 @@ function getClosestVehicle(coords, src)
|
|||||||
end
|
end
|
||||||
|
|
||||||
return closestVehicle, closestDistance
|
return closestVehicle, closestDistance
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Checks whether a vehicle is owned or not using the plate as reference
|
||||||
|
---
|
||||||
|
--- @param plate string The plate of the vehicle to check
|
||||||
|
--- @return boolean whether vehicle is owned
|
||||||
|
---
|
||||||
|
--- @usage
|
||||||
|
--- ```lua
|
||||||
|
--- local plate = "ABCD1234"
|
||||||
|
--- local isVehicleOwned = isVehicleOwned(plate)
|
||||||
|
--- ```
|
||||||
|
local vehiclesOwned = {}
|
||||||
|
|
||||||
|
function isVehicleOwned(plate)
|
||||||
|
vehDatabase = "player_vehicles"
|
||||||
|
if isStarted(ESXExport) then vehDatabase = "owned_vehicles"
|
||||||
|
elseif isStarted(OXCoreExport) then vehDatabase = "vehicles" end
|
||||||
|
|
||||||
|
if vehiclesOwned[plate] == true then
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
local result = MySQL.query.await("SELECT 1 from "..vehDatabase.." WHERE plate = ?", { plate })
|
||||||
|
if json.encode(result) ~= "[]" then
|
||||||
|
vehiclesOwned[plate] = true
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
Reference in New Issue
Block a user