Advertisement
Guest User

PTFX Example

a guest
Dec 28th, 2016
324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.87 KB | None | 0 0
  1. void AddFXTrail(Entity e, Vector3 posOffset)
  2.         {
  3.             if (e != null && e.Exists())
  4.             {
  5.                 Function.Call(Hash.REQUEST_NAMED_PTFX_ASSET, "scr_minigamegolf");
  6.                 Function.Call(Hash._SET_PTFX_ASSET_NEXT_CALL, "scr_minigamegolf");
  7.  
  8.                 if (!Function.Call<bool>(Hash.DOES_PARTICLE_FX_LOOPED_EXIST, FxName)) //FxName is a global int in this example
  9.                 {
  10.                     FxName = Function.Call<int>(Hash.START_PARTICLE_FX_LOOPED_ON_ENTITY, "scr_golf_ball_trail", e, posOffset.X, posOffset.Y, posOffset.Z, 0.0, 0.0, 180.0, 3.0, false, false, false);
  11.                     Function.Call(Hash.SET_PARTICLE_FX_LOOPED_COLOUR, FxName, 0f, 10f, 250f, false);
  12.                 }
  13.             }
  14.         }
  15.  
  16.         void StopFXTrail()
  17.         {
  18.             Function.Call(Hash.REMOVE_PARTICLE_FX, FxName, true);
  19.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement