Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
Added Tow to lawyer list. It has been something people have asked for, for a while.
  • Loading branch information
istoking committed Jan 24, 2025
1 parent 9f32c41 commit 0054670
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
26 changes: 24 additions & 2 deletions html/js/lawyers.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ SetupLawyers = function(data) {
var taxi = [];
var police = [];
var ambulance = [];
var tow = [];

if (data.length > 0) {

Expand All @@ -28,6 +29,9 @@ SetupLawyers = function(data) {
if (lawyer.typejob == "ambulance") {
ambulance.push(lawyer);
}
if (lawyer.typejob == "tow") {
tow.push(lawyer);
}
});

$(".lawyers-list").append('<h1 style="font-size:1.641025641025641vh; padding:1.0256410256410255vh; color:#fff; margin-top:0; border-top-left-radius: .5vh; border-top-right-radius: .5vh; width:100%; display:block; background-color: rgb(42, 137, 214);">Lawyers (' + lawyers.length + ')</h1>');
Expand Down Expand Up @@ -107,6 +111,19 @@ SetupLawyers = function(data) {
var element = '<div class="lawyer-list"><div class="no-lawyers">There is no ems available.</div></div>'
$(".lawyers-list").append(element);
}

$(".lawyers-list").append('<br><h1 style="font-size:1.641025641025641vh; padding:1.0256410256410255vh; color:#fff; margin-top:0; width:100%; display:block; background-color: rgb(67, 3, 72);">Tow (' + tow.length + ')</h1>');

if (tow.length > 0) {
$.each(tow, function(i, lawyer6) {
var element = '<div class="lawyer-list" id="lawyerid6-' + i + '"> <div class="lawyer-list-firstletter" style="background-color: rgb(67, 3, 72);">' + (lawyer6.name).charAt(0).toUpperCase() + '</div> <div class="lawyer-list-fullname">' + lawyer6.name + '</div> <div class="lawyer-list-call"><i class="fas fa-phone"></i></div> </div>'
$(".lawyers-list").append(element);
$("#lawyerid6-" + i).data('LawyerData', lawyer6);
});
} else {
var element = '<div class="lawyer-list"><div class="no-lawyers">There is no tow available.</div></div>'
$(".lawyers-list").append(element);
}
} else {
$(".lawyers-list").append('<h1 style="font-size:1.641025641025641vh; padding:1.0256410256410255vh; color:#fff; margin-top:0; border-top-left-radius: .5vh; border-top-right-radius: .5vh; width:100%; display:block; background-color: rgb(42, 137, 214);">Lawyers (' + lawyers.length + ')</h1>');

Expand All @@ -130,12 +147,17 @@ SetupLawyers = function(data) {

$(".lawyers-list").append('<br><h1 style="font-size:1.641025641025641vh; padding:1.0256410256410255vh; color:#fff; margin-top:0; width:100%; display:block; background-color: rgb(0, 102, 255);">Police (' + police.length + ')</h1>');

var element = '<div class="lawyer-list"><div class="no-lawyers">There are no polices a available.</div></div>'
var element = '<div class="lawyer-list"><div class="no-lawyers">There are no police available.</div></div>'
$(".lawyers-list").append(element);

$(".lawyers-list").append('<br><h1 style="font-size:1.641025641025641vh; padding:1.0256410256410255vh; color:#fff; margin-top:0; width:100%; display:block; background-color: rgb(255, 0, 0);">Ambulance (' + ambulance.length + ')</h1>');

var element = '<div class="lawyer-list"><div class="no-lawyers">There are no ambulance personnel a available.</div></div>'
var element = '<div class="lawyer-list"><div class="no-lawyers">There are no ems available.</div></div>'
$(".lawyers-list").append(element);

$(".lawyers-list").append('<br><h1 style="font-size:1.641025641025641vh; padding:1.0256410256410255vh; color:#fff; margin-top:0; width:100%; display:block; background-color: rgb(67, 3, 72);">Tow (' + tow.length + ')</h1>');

var element = '<div class="lawyer-list"><div class="no-lawyers">There are no ems available.</div></div>'
$(".lawyers-list").append(element);
}
}
Expand Down
3 changes: 2 additions & 1 deletion server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,8 @@ QBCore.Functions.CreateCallback('qb-phone:server:GetCurrentLawyers', function(_,
if Player ~= nil then
if (Player.PlayerData.job.name == 'lawyer' or Player.PlayerData.job.name == 'realestate' or
Player.PlayerData.job.name == 'mechanic' or Player.PlayerData.job.name == 'taxi' or
Player.PlayerData.job.name == 'police' or Player.PlayerData.job.name == 'ambulance') and
Player.PlayerData.job.name == 'police' or Player.PlayerData.job.name == 'ambulance') or
Player.PlayerData.job.name == 'tow' and
Player.PlayerData.job.onduty then
Lawyers[#Lawyers + 1] = {
name = Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname,
Expand Down

0 comments on commit 0054670

Please sign in to comment.