60 Mods geliked
1 Kommentar
0 Videos
0 Uploads
0 Follower
This is a really cool idea/mod! Well done man!!!
Anyway, about the bugs you mentioned in the description:
I haven't really worked with C# or the whole SHV/SHVDN, but I looked a bit into your code, and I think I have an idea what's causing all the problems!
1. As I tested, looks like the `GetNearbyPeds` method gives you a reference to the ped objects (which means the values inside them will change while the game goes on).
2. The `Script.Wait(1)` that you put inside of your `PedDam` method blocks your script for a moment.
So, now, while your script is blocked by your call to the `Wait` method, the data inside the peds' objects will change.
My solution...
1. Extract the primary speed of all vehicles.
2. Use the `Wait` method.
3. Extract the secondary speed of all vehicles.
4. Do the rest as before.