@hitler123
https://www.gta5-mods.com/scripts/spawn-where-you-died
Many spawn options.
Only stores ped model though.
@hitler123
https://www.gta5-mods.com/scripts/spawn-where-you-died
Many spawn options.
Only stores ped model though.
@dimedius
Everything that can be called once should be called once. Since performance hit depends on how often you call it, in this case it doesn't matter.
For example Menyoo could pre-hash but in many cases won't since the performance hit is neglectable: https://github.com/MAFINS/MenyooSP/search?q=get_hash_key&type=
I think Alexander Blade does this as well.
You generate the hash before the loop and then store it a variable that can be used in your loop.
However if you really want to, you could make a variable and set it to the hash value, since you know the hash already. Just make sure there's documentation/comments to identify what the hash represents.
I saw your 1.1 version. Great progress.
I like to use this native to get the hash for readability (called once):
Hash secBarrier1 = GAMEPLAY::GET_HASH_KEY("prop_sec_barrier_ld_01a");
Hash secBarrier2 = GAMEPLAY::GET_HASH_KEY("prop_sec_barrier_ld_02a");
Saw that you're already using Codewalker after writing this.
But for others:
Codewalker is a great tool to find out the name, hash of objects etc. You can move around in the world finding them.
(Press Load DLC, Press T, Press select objects, Right click on an object gives info to the right.
Awesome that you solved it.
Adding a check for all peds, not just the player would be nice. Like once every 2 sec. With performance in mind. If nothing should happen if not in a vehicle, that check could come first for example.
Good job!
The game is probably running some task on the peds when in that state, altering their behavior with different configuration values. Are you saying this issue is occurring for your weapon only?
Animals are also considered peds. I don't know what the .Net method does exactly but I'm sure it works fine. The native function for getting the closest ped doesn't reliably return the closest You can do it more manually, like something like this in C++
https://pastebin.com/8nhL4zsa
@dimedius For example you could make a simple program, looking through all the files mcal9909 linked to above.
Since "_DOOR_CONTROL" and "prop_sec_barrier_ld_02a" probably are only used in a few scripts, you'll narrow down the potential interesting files.
Write all occurrences (lines with your search word in them) together with the script name to a text file (row number and occurrence count as well ofc if you want).
Then open your created text file, find out which scripts that seems interesting and simply open them and CTRL+F "_DOOR_CONTROL" and "prop_sec_barrier_ld_02a".
That's one way of doing it.
Have you checked how R* does it in their scripts?