ESX_Mugging

If you look at the script you will see where it makes the ped get out of the vehicle. You can code it to flag that ped as driver - and if flagged as driver have your key system give you the keys to that car.

Shouldn’t be hard to change … but as a generic add keys would have to be setup to to work with your server key system… so would be hard for me to generic code into this script.

SpikE

1 Like

Anyone else having trouble getting this to work? It seems like an awesome script but the peds just run away when i pull my gun to test it

2 Likes

… if they are running away… by any chance do you have your character set to police officer?

Great script!!
How can I add an offset or something? Because on my server I removed the crosshair and as I don’t see it sometimes happens that I don’t have the gun pointed right at the ped and he flees right away when I take the gun away from him or move a bit right or left…

Without using crosshair could go into first person … this script uses GetEntityPlayerIsFreeAimingAt and that just returns true/false and entity number… so really can’t add a offset value to the aiming process.

SpikE

Hi there, first of all awesome script!

So far though, when i hold up a ped, it will say “mug” infront of them, they will stand there and not move as long as gun is pointed at them, but it does not say “press E to mug” and when i press E nothing happens, did i miss something?

If it just says “mug…” then you have MustUseVoice set to true on the config and if you use ingamevoice and speak in game it will start the mugging.

If your server uses TokyoVoip and teamspeak for voice communication you will just need to turn off the option in Config.MustUseVoice = false

SpikE

i have edited the config on github so that setting is turned off by default.

1 Like

Hi mate thanks for the quick reply, i disabled the voice and it works, i also had to disable progress bar but it works all good now.

Glad you got it sorted out

Hi I’m having an issue where when a player mugs a npc in a vehicle they are not getting out of the vehicle. Is there any fix for this?

I worked with another server on this issue the other day… it is going past the one step that tells them to get out of the car and moving on. Let me look at the code and can update the github with the fix.

SpikE

I have updated the github with a loop to check if ped is out of car before moving on … should solve the issue of mugging people still inside of their car.

SpikE

It would be great if the update says that it changed, I use the resource and it works very well, to do the update I would only need to change the lines, thank you very much for your work friend

The part that was changed was this

TaskLeaveVehicle(targetPed, localvehicle, 1)
    incar = true
    while incar do
         Citizen.Wait(100)
         if not IsPedInAnyVehicle(targetPed, false) then incar = false end
    end
ResetPedLastVehicle(targetPed)

I just added the while incar loop to see if the npc is in the car or not before moving on.

SpikE

also just noticed a error in the code i added… should be if not IsPedInAnyVehile(targetPed, false) then

Sorry for anyone that updated and it broke it.

Hi there Spike,

Do you possibly have any progress made on the issue using GCPhone? We get the alerts as Police, but it sends a message to the Police from every current online Police officer when a mugging takes place in the city.

find any fix for this?>

Sorry for the slow response… but the only reason a ped would run away when you pull your gun out… would be the number of police needed to mug someone is set higher then the current # of police in the city or you are set to a police officer yourself.

If you want to msg me your server ip i will be more then happy to have a look at what is going on with it.

SpikE

Not sure exactly what you mean by it sends a msg from every current only police officer… if you can dm me your server details i would be more then happy to jump on and see what might be causing this for you.

SpikE

Never mind i just had a look at the code… and i can see exaclty what it is doing… for a temp fix i would switch over to not useing gcphone until i can get a fix sorted for this… I can’t believe this script has been out this long and I never noticed that it is making every police officer send out a txt msg :smiley:

SpikE