Reck1501 Posted May 25, 2015 Share Posted May 25, 2015 I'm trying to make an explosion at the bullet impact coords, but the game keeps crashing when I enable it. float[] coords = new float[6]; coords = Function.Call<float[]>(Hash.GET_PED_LAST_WEAPON_IMPACT_COORD, playerped, coords[0]); GTA.Math.Vector3 position = new GTA.Math.Vector3(coords[0], coords[2], coords[4]); World.AddExplosion(position, ExplosionType.Molotov1, 1, 0); Link to comment Share on other sites More sharing options...
Neutrinobeam Posted May 26, 2015 Share Posted May 26, 2015 The Native uses the pattern, Any r = WEAPON::GET_PED_LAST_WEAPON_IMPACT_COORD(Ped pedHandle, float * coords) I'm guessing the third parameter should be the equivalent of a pointer to your coords (OutputArgument?) and the return value might be related to success or failure. . Odd that it's supposedly packed like that. Link to comment Share on other sites More sharing options...
Kryo4lex Posted May 26, 2015 Share Posted May 26, 2015 (edited) static Any GET_PED_LAST_WEAPON_IMPACT_COORD(Any p0, float* Coords) { return invoke<Any>(0x6C4D0409BA1A2BC2, p0, Coords); } // 6C4D0409BA1A2BC2 9B266079 You have to change the native in the "native.h" file. The usage looks like this: float tmp[6];float x,y,z;WEAPON::GET_PED_LAST_WEAPON_IMPACT_COORD(PLAYER::PLAYER_PED_ID(), tmp);x=tmp[0];y=tmp[2];z=tmp[4]; In this case, "x", "y" and "z" represemnt the coordinates of the impact, which can be accessed by accessing the elements of the float array with 6 elements with even indexes (tmp[0], tmp[2] ,tmp[4]) I think there is no way in .NET at the moment, because the native is implemented wrong. Edited May 26, 2015 by Kryo4lex Link to comment Share on other sites More sharing options...
Reck1501 Posted May 27, 2015 Author Share Posted May 27, 2015 static Any GET_PED_LAST_WEAPON_IMPACT_COORD(Any p0, float* Coords) { return invoke<Any>(0x6C4D0409BA1A2BC2, p0, Coords); } // 6C4D0409BA1A2BC2 9B266079 You have to change the native in the "native.h" file. The usage looks like this: float tmp[6];float x,y,z;WEAPON::GET_PED_LAST_WEAPON_IMPACT_COORD(PLAYER::PLAYER_PED_ID(), tmp);x=tmp[0];y=tmp[2];z=tmp[4]; In this case, "x", "y" and "z" represemnt the coordinates of the impact, which can be accessed by accessing the elements of the float array with 6 elements with even indexes (tmp[0], tmp[2] ,tmp[4]) I think there is no way in .NET at the moment, because the native is implemented wrong. I had already changed the native.h, though it still doesn't work. And the example you gave me is C++, not C# Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now