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.
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.
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?
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.
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.
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
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.
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.
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.
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.
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