Log in to reply
 

[C#] Particle FX



  • Hello, I would like to know how to do particle FX with C# If you happen to know how please reply with an answer





  • @stillhere Thanks! I will learn off of this.



  • @Rjvisser01 Thank you!



  • @stillhere Do you know how to get to the closest ped and make sure its NOT the players character?



  • I usually only use GetClosestPed when I need the closest ped in front of the player, so I do something like
    Ped closestPed = World.GetClosestPed(player.Position + player.ForwardVector * 1.5f, 1.5f); if (closestPed != player) { //Do something }
    But do you need to get the closest ped from any direction?



  • How would we go about emulating the particle FX happening in the Flash mod? They seem pretty straightforward, but I have never messed with them

    Function.Call<vector3>(Hash.GET_OFFSET_FROM_ENTITY_GIVEN_WORLD_COORDS, 365830, -1595.558f, -2270.925f, 1.64694f);
    Function.Call<vector3>(Hash.GET_OFFSET_FROM_ENTITY_GIVEN_WORLD_COORDS, 365830, -1595.274f, -2270.977f, 1.605614f);
    Function.Call(Hash.SET_ENTITY_MAX_SPEED, 365830, 204.0263f);
    Function.Call<int>(Hash._CAST_RAY_POINT_TO_POINT, -1596.26f, -2270.684f, 1.96384f, -1596.26f, -2270.684f, -3.03616f, 18446744073709551615, 365830, 7);
    Function.Call<int>(Hash._GET_RAYCAST_RESULT, 410383, 3769295544, 7235042304, 7235042336, 3769295584);
    Function.Call<bool>(Hash.GET_GROUND_Z_FOR_3D_COORD, -1596.26f, -2270.684f, 1.96384f, 7235042368, );
    Function.Call<bool>(Hash.GET_WATER_HEIGHT, -1596.26f, -2270.684f, 1.116963f, 7235042400);
    Function.Call(Hash.SET_ENTITY_VELOCITY, 365830, -17.72155f, 5.03733f, -0.005747078f);
    Function.Call(Hash.SET_ENTITY_VELOCITY, 365830, -17.72155f, 5.03733f, 1.292698f);
    Function.Call(Hash.SET_ENTITY_ANIM_SPEED, 365830, "move_m@generic", "sprint", 1.75392f);
    Function.Call<any>(Hash._CAST_3D_RAY_POINT_TO_POINT, -1597.543f, -2269.903f, 2.202827f, -1665.885f, -2250.474f, -8.205606f, 1f, 18446744073709551615, 365830, 7);
    Function.Call<int>(Hash._GET_RAYCAST_RESULT, 410639, 3769294488, 7235042496, 7235042464, 3769294528);
    Function.Call<bool>(Hash.DOES_ENTITY_EXIST, 71943);
    Function.Call<int>(Hash.GET_ENTITY_TYPE, 71943);
    Function.Call(Hash.GET_MODEL_DIMENSIONS, 0x705E61F2, 7235042816, 7235042848);
    Function.Call<any>(Hash._CAST_3D_RAY_POINT_TO_POINT, -1597.308f, -2270.386f, 2.017f, -1597.308f, -2270.386f, -0.2279997f, 0.5f, 18446744073709551615, 365830, 7);
    Function.Call<int>(Hash._GET_RAYCAST_RESULT, 476684, 3769295304, 7235042880, 7235042912, 3769295344);
    Function.Call<any>(Hash._CAST_3D_RAY_POINT_TO_POINT, -1597.267f, -2269.982f, 2.144892f, -1692.44f, -2242.925f, -12.34996f, 0.1f, 12, 365830, 7);
    Function.Call<int>(Hash._GET_RAYCAST_RESULT, 356617, 3769295560, 7235042944, 7235042976, 3769295600);
    Function.Call<any>(Hash._CAST_3D_RAY_POINT_TO_POINT, -1597.267f, -2269.982f, 2.144892f, -1692.44f, -2242.925f, -12.34996f, 0.2f, 12, 365830, 7);
    Function.Call<int>(Hash._GET_RAYCAST_RESULT, 410895, 3769295560, 7235043008, 7235043040, 3769295600);

    These were some of the functions I captured while using the mod.

    There seem to be Rays attached to different body parts, as soon as I get any particle effect working, I can go from there. The effects also only appear while I am moving, any tips? Thanks



  • @NotCrunchyTaco Did you manage to get the particle effects? I am trying to get some fireworks effect or similar to it.



  • @NotCrunchyTaco NVM got it worked.


Log in to reply
 

Looks like your connection to GTA5-Mods.com Forums was lost, please wait while we try to reconnect.