Hello everyone, I've successfuly managed to spawn object in the game, although I would need to store it in C# to be able to handle them, rotate them and such. But the thing is that Rage Plugin Hook for RDR2 has no such variables that I could use to store them, and whenever I try to store them to a normal c# object, it throws an error.
I call this native "CREATE_OBJECT" (0x509D5878EB39E842), like this:
Game.CallNative(0x509D5878EB39E842, "P_GEN_POSTERWANTED05X".HashCode(), PlayerPed.Position.X, PlayerPed.Position.Y, PlayerPed.Position.Z, false, false, true, false, false);
But just as the NativeDB states, this native returns a Type "Object". So I would have to use:
Some_var_Type _object = Game.CallNative<Some_var_Type>(0x509D5878EB39E842, "P_GEN_POSTERWANTED05X".HashCode(), PlayerPed.Position.X, PlayerPed.Position.Y, PlayerPed.Position.Z, false, false, true, false, false);
to store it.
Everytime I try to create it like this:
object _object = Game.CallNative<object>(0x509D5878EB39E842, "P_GEN_POSTERWANTED05X".HashCode(), TfaRageUtils.PlayerPed.Position.X, TfaRageUtils.PlayerPed.Position.Y, TfaRageUtils.PlayerPed.Position.Z, false, false, true, false, false);
it throws the following error:
System.ArgumentException: The specified structure must allow representation by bits / bytes or have schema information.
With code: -2147024809
How can I manage this? Or is it currently impossible?
Thank you in advance!