ESX_Mugging

I was looking into that situation as the server I play on we have stationary NPC as well for doctors we do not want people to be able to mug. I am looking at having it check the entity to see if it is a MissionEntity before the mugging and if it is have it ignore the mugging.

Hopefully this will be in the next release i hope to have out tonight and will solve your issue.

SpikE

Was able to get a quick update out that will now have any MissionEntity NPC ignore the script completly. If they are suppost to just stand there… that is what they will do. Hope this works for your server same as i did on my test server.

SpikE

i havent been able to check this out… but do the NPC’s stick their hands up and is it synced between all players? and then does the NPC put their hands down and run after the robbery? the ROBNPC script i use the NPC’s never put their hands down. The other players cannot see it, and you can rob normal players but the server treats it like an NPC… so you dont actually take another players personal money… and your PED only has hands up on the side of the person doing the robbery.

The testing I did on the server i play on you will see if someone else is mugging a NPC (hands up).

As for after robbery - i have spent a fair bit of time tying to get them to 100% run after mugging… but seems like the first npc you mug has a chance of getting frozen with hands up for a few seconds and then walks off… but the rest the NPC should get scared and run off if you are still aiming at them after the mugging.

As for other Mugging other players - this script checks to see if you are aiming at a player and if you are it ignores the mugging part of the script - so no mugging other players.

Hopefully this answers your questions

SpikE

Thanks for the credits and for asking for permission mate.

I have GCPHONE, but when I kill this NPC so police didnt get phone message alert… Can you help me

1 Like

Its not 100% notifcation rate for police… do you have esx_jobs and esx_policejob on your server. It will notify anyone that has ESX.PlayerData.job.name == ‘police’ in the form of a ESX.ShowAdvancedNotification so not sure why you wouldn’t get a notification if you have job set to police and a alert was sent out.

If you want to pm me your server i can help test it.

SpikE

Appreciate that, no further errors it seems, good work buddy!

Sorry for not putting the credit and link to your post on here… it is on the github ReadMe so anyone that downloads will see that this is based off your orginal script. But i will put it on here as well.

Thanks, also what error was it that caused the CPU usage?

Great work with the script!

I was trying to fix the - not noticing when change of job after login… and put the request to get job name inside of a loop where it shouldn’t have been. So was requesting job name every tick which was a huge issue :smiley:

This is AMAZING! thanks for release this resource, but we need a script line for notifications with the gcphone and a minimum cops in service for mug

did you find to mugg only a certain type of ped ?

I did add the check for MisionEntity for NPC to not allow robbing of static npc’s on server like the store clerks or doctors some servers have stationed around the city. So any ped that are marked as a mission entity will just ignore the script.

SpikE

Have a video for me to see
I tried this clip and I E or the attacker didn’t see anything happening at all.

I am not good at English

Ill post a video in just a min then. Let me record one

Added video to main post show demo.

what if i want them to only mugg the store clerks ? need to add the peds hash ?

Been looking at this for a while, haven’t tested yet but seems like a solid script your are dedicated to. Appreciate people like you.

If you want to only mug Mission Entity you could change line 52

and not IsEntityAMissionEntity(targetPed) then <-- change this

and IsEntityAMissionEntity(targetPed) then <-- to this

This will ignore any entity’s that are not Mission Entity. If that does not work for your needs msg me and im sure we can get it working how you need.

SpikE