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

Update #403

Open
wants to merge 2 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
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 @@ -580,7 +580,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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the or Player.PlayerData.job.name == 'tow' need to be before the closing parenthesis?

Player.PlayerData.job.onduty then
Lawyers[#Lawyers + 1] = {
name = Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname,
Expand Down
Loading