[Release] jsfour-criminalrecord [ESX]


#41

can anybody help me? I have separate jobs, like CHP, Sheriff, FBI and others. How can I allow these other jobs to access Criminal Records?
I am not a professional programmer, but I am trying to become alone, but this one is difficult. I tried to put this code here, could someone help me where I went wrong?

-- Display marker and Enter/Exit events
Citizen.CreateThread(function ()
  while true do
    Wait(0)
		if PlayerData.job ~= nil and PlayerData.job.name ~= 'unemployed' and PlayerData.job.name == "police" and PlayerData.job.name == "chp" and PlayerData.job.name == "sheriff" then
			v = Config.Marker
	    if( v.Type ~= -1 and GetDistanceBetweenCoords(GetEntityCoords(GetPlayerPed(-1)), v.Pos.x, v.Pos.y, v.Pos.z, true) < 50 ) then
	      DrawMarker(v.Type, v.Pos.x, v.Pos.y, v.Pos.z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, v.Size.x, v.Size.y, v.Size.z, v.Color.r, v.Color.g, v.Color.b, 100, false, true, 2, false, false, false, false)
	    end
			if( v.Type ~= -1 and GetDistanceBetweenCoords(GetEntityCoords(GetPlayerPed(-1)), v.Pos.x, v.Pos.y, v.Pos.z, true) < v.Size.x ) then
	      inMarker = true
				hintToDisplay(v.Hint)
			else
				inMarker = false
	    end
		end
	end
end)

These other professions can not access, because the marking does not appear for them, in fact it even appears to the police. Can someone help me?


#43

It did not work, thank you anyway.


#44

try this

-- Display marker and Enter/Exit events
Citizen.CreateThread(function ()
  while true do
    Wait(0)
		if PlayerData.job ~= nil and PlayerData.job.name ~= 'unemployed' and PlayerData.job.name == "police" or
		PlayerData.job ~= nil and PlayerData.job.name ~= 'unemployed' and PlayerData.job.name == "jobname" or
		PlayerData.job ~= nil and PlayerData.job.name ~= 'unemployed' and PlayerData.job.name == "jobname" or
		PlayerData.job ~= nil and PlayerData.job.name ~= 'unemployed' and PlayerData.job.name == "jobname" or
		PlayerData.job ~= nil and PlayerData.job.name ~= 'unemployed' and PlayerData.job.name == "jobname" or
		PlayerData.job ~= nil and PlayerData.job.name ~= 'unemployed' and PlayerData.job.name == "jobname" or
		PlayerData.job ~= nil and PlayerData.job.name ~= 'unemployed' and PlayerData.job.name == "jobname" then
			v = Config.Marker
	    if( v.Type ~= -1 and GetDistanceBetweenCoords(GetEntityCoords(GetPlayerPed(-1)), v.Pos.x, v.Pos.y, v.Pos.z, true) < 50 ) then
	      DrawMarker(v.Type, v.Pos.x, v.Pos.y, v.Pos.z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, v.Size.x, v.Size.y, v.Size.z, v.Color.r, v.Color.g, v.Color.b, 100, false, true, 2, false, false, false, false)
	    end
			if( v.Type ~= -1 and GetDistanceBetweenCoords(GetEntityCoords(GetPlayerPed(-1)), v.Pos.x, v.Pos.y, v.Pos.z, true) < v.Size.x ) then
	      inMarker = true
				hintToDisplay(v.Hint)
			else
				inMarker = false
	    end
		end
	end
end)

#45

Thank you, solved my problem. Now everything is working.


#47

Since people can’t read I’ll say this one more time. I will turn of notifications for this post.

Create an issue at github if you need help

My discord: jonassvensson4#3011


#48

It’s a nice idea but there’s lot of problems that you need to fix

  1. Why not searching the man name ONLY and use offense?
  2. Why using DOB?
  3. Line 51: Why checking every frame is marker and ispressed instead moving in to the display?
    BTW You did that none police can join too.
  4. A lot of junk code on css, and lua.
    Look like its not ready yet and you just released it.
  5. Things like eye color that only stays on db…

And I’m sure I can find more.
I recommend you to rewrite the whole script. I can help you btw.


#49

There was 1 problem you found, thanks for pointing that out.

  1. Have no idea what you’re talking about, “man name”?
  2. It’s my script I decide what it will use. Don’ want to use it? Create your own.
  3. Thanks for pointing that out, I’ll update it. (Have no idea what you mean by “none police can join” though)
  4. This is pure bullcrap, come up with something more concrete. There are no junk code in the css. It’s ugly, I know, but it’s not like I have to make it responsive = ugly code is fine.
  5. What?

I won’t rewrite it but you’re more than welcome to write your own and share it with the community.


#50

I’m using his ressources since a “long time” and I can tell you that his job his amazing.
Of course as each ressource you download you will have to modify it to make it correspond to your requirements.
Using DOB and Lastdigits is a great idea to get a “personnal number” that is unique.
For my case I have modified the type of DOB, the lastdigits to phone number and transposed this format to all of his resources.
Now, criminal logs, the police mobile computer, the ID cards works perfectly and totally communicate between them.
Of course for that, you will have to do some edits that are more than a simple drag and drop.
Don’t forget that he is sharing his work and doing readmes to help “drag and drop devs” and you are still finding things to complain about …


#51

Eeee, how to exit this menu? Cause if i press ESC , menu is hiding and mouse is freezing.


#52

Maybe you should read the instructions at the github?

You have the wrong name of the folder…


#53

Hey, Don’t get me wrong. Your scripts are amazing and you are a great developer.
I just pointed out couple things.
By meaning police join I meant that people without the police job can use it.
On the database it saves the color eye. Why?
I just showed you couple thing that will make the script better.
Oh and if I want to search on someone. How the hell I will get his ID? that’s the main problem


#54

You’re asking me why I’m saving the eye color but not the hair color or the gender? Since we can’t send the mugshot to the javascript this is the best I could do. It’s not much but it’s something that could help the police finding the right person. If I remove those two, sure it would take up a couple of bytes less but if you don’t have those extra bytes on your server you should considering upgrading it. But hey, if you don’t want them just remove them?

if you’ve downloaded the new version it should only allow players with the police job to use it. (It was updated before you wrote the first post).

It’s not my problem how you decide to get the players ID. Use a script for it? It would be really weird to have a criminal record without the DOB. You must be the only one that’s not using the DOB.


#55

I have a problem that I when I exit the mouse freezes.


#56

Because you did not name it jsfour-criminalrecord if you name it something else that wil happen


#57

I need your help


#58

Unfortunately you cut the screenshot off right at the part where it’s important. You’ll want to paste or screenshot the whole error if you want people to be able to tell you what’s wrong.


#59

I have problem. There is good information about suspect but… https://cdn.discordapp.com/attachments/480668937126674432/507965701655494658/unknown.png


#60

You have test as a dob in the database as well?


#61

I dont know. It worked only once, but more failed


#62

Very nice script. However, I turned it into two scripts. One only allows searching the database at the 2 sheriff stations and the LSPD @ Mission Row. The other is set in the booking room and that is where you add records when booking a prisoner.