[Release] PD5M - Multiplayer PvE Police Script - Ambient Events

with the game pad or a keyboard?

Hey,
I heard about this bug a few times but haven’t been able to really determine what caused it. Sent you a DM, hope we can get to the bottom of it.

Fixed. To everyone who has the same error: Please check that your resource-name is written pd5m in all lowercase letters!

Release of a quick fix - v0.1.3.1

  • Fixed a bug related to multicharacter scripts in ESX / vRP that caused a crash of radialmenu
2 Likes

anyone have any idea what could be causing general peds in the game to ignore me? i can shoot and carry on and all the peds ignore me

Neeeevermind

Yes, PD5M is causing this. This is also intended because this way policing will not cause absolute chaos.
If you want to try it out you need to change two files:
open pd5m/Startup/startup_cl.lua and comment out line 3 (disable SetIgnoreLowPriorityShockingEvents(player, true)
open pd5m/__resource.lua and comment out line 105 (disable Ìnteraction/pednopanic_cl.lua)

There’s still the calls for E when doing other things, like opening doors and taking out vehicles from garages as police. :stuck_out_tongue:

and should the folders name be set et small letters to avoid the multi-charater issues?

What do you mean with calls for “E”?

Foldername is to be lowercase only because radialmenu uses an NUI-function. I’m not entirely sure how it works but that function only works if the resourcename is lowercase only (comparable to how every single internet page will have a lowercase name only, e.g. fivem.net for FiveM). The docs explain this:

The multi-character issue happens as follows:
The permission system in PD5M works by checking PlayerData.job.name == police. The background is that when connecting to an ESX-server your config data will get loaded. This is a list PlayerData which includes a list job that includes its name.

Now multi-character scripts don’t have you instantly load a configuration on connect but only after you have chosen your char. However this means that the check will return an error: Since PlayerData is not yet defined, it’ll return nil. Now Lua doesn’t like it at all if you try to index a nil-value thus the radialmenu-script crashes.
To fix it I am checking if the lists are defined:

if PlayerData ~= nil then
   if PlayerData.job ~= nil then
      if PlayerData.job.name == 'police' then
.
.
.

etc. This way if your character wasn’t yet loaded the first if-clause returns false thus the error-prone message will never be checked.

Now I’m not sure if it’s the best way to approach that error but it surely works.

so i made it look like this
–SetIgnoreLowPriorityShockingEvents(player, true)
SetPoliceIgnorePlayer(player, true)
–SetPlayerCanBeHassledByGangs(player, false)

and

–“Interaction/pednopanic_cl.lua”,

, restarted the script, does not seem to help much, I will give you a update after I restart the server, there are people on it right now be later tonight
Thanks again
for all your help

that fixed it thanks!

Yikes you don’t even have permission

Read again:
I got permission from Warxander.

Now read the forum rules again:

Sharing content that is not yours is allowed as long as you credit the original author and don’t violate their terms/license. Try to contact the author via their contact information found on their profile, leaving a comment/reply, or by creating an issue (if it’s a repository). After allowing the original author time to reply ( ~1 week ) and you’ve not received a reply, you may use their content under the terms that you credit them and share your contact attempt (i.e. with a screenshot).

Only thing I didn’t do is sharing my contact attempt (because a direct message is above anything private) but mentioned that I would provide proof on demand.

So yeah, I got the permissions I could get and am save according to the release rules. Also I specifically mention that I hope Brent will give his permission (read that as I will remove radialmenu if he voices that he doesn’t approve of it).

Is that enough permission for you?

Silverman - the Npc doctors and Towtrucks worked better in the first script. They can’t find the cars and npcs in like75% of the times they’re called.

1 Like

Do you have the original files still?

1 Like

Do you mean PIS or my first publish? Either way, I got them. Thanks for the bug report. Since I only did one change I feel like I know exactly what the issue is… will not revert but try fixing the issues tomorrow correctly.

holy cow I did not know you made PIS thats what i get for not reading , I loved that too

1 Like

Hello @Silverman.
I love the script and the idea I do tho have 1 problem not sure if it’s only on my end but when I click “X” the menu won’t close no matter what I do. I also have a problem with the E Menu where it dosent show up when am talking to peds. I have the newest version installed.

The problem is that if you press “E” as cop, like if you want to open a door or take out a car from the ls customs garage you get the “Notify” in the left corner, “no peds or cars close” or something like that. That’s unfortunate and a bit annoying. I took the 1.1 script you made for Tow and Ambulances. And it works perfectly, so yeah… thanks for fixing things :slight_smile:

i have the same issue as captain_waterloo. i dont run esx or vrp, is this the problem?