Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using GTA;
- #pragma warning disable 1591 // Missing XML comments.
- namespace Functions
- {
- public class Effects
- {
- #region Fields
- private string effectName = string.Empty;
- private int effectID = 0;
- private bool effectRunning = false;
- #endregion
- #region Constructor
- public Effects(string effectName)
- {
- this.effectName = effectName;
- }
- #endregion
- #region Properties
- public int EffectID
- {
- get
- {
- return this.effectID;
- }
- }
- #endregion
- #region Methods
- public int Start(Vector3 position, Vector3 rotation, float scale)
- {
- if (!this.effectRunning)
- {
- this.effectRunning = true;
- return (this.effectID = GTA.Native.Function.Call<int>("START_PTFX", this.effectName, position.X, position.Y, position.Z, rotation.X, rotation.Y, rotation.Z, scale));
- }
- return 0;
- }
- public int Start(Vector3 position, float scale)
- {
- return this.Start(position, Vector3.Zero, scale);
- }
- public int Start(Vector3 position)
- {
- return this.Start(position, Vector3.Zero, 1.0f);
- }
- public int StartOnObject(GTA.Object obj, Vector3 offset, Vector3 rotation, float scale)
- {
- if (!this.effectRunning)
- {
- this.effectRunning = true;
- return (this.effectID = GTA.Native.Function.Call<int>("START_PTFX_ON_OBJ", this.effectName, obj, offset.X, offset.Y, offset.Z, rotation.X, rotation.Y, rotation.Z, scale));
- }
- return 0;
- }
- public int StartOnObject(GTA.Object obj, Vector3 offset)
- {
- return this.StartOnObject(obj, offset, Vector3.Zero, 1.0f);
- }
- public int StartOnObject(GTA.Object obj)
- {
- return this.StartOnObject(obj, Vector3.Zero, Vector3.Zero, 1.0f);
- }
- public int StartOnVehicle(GTA.Vehicle vehicle, Vector3 offset, Vector3 rotation, float scale)
- {
- if (!this.effectRunning)
- {
- this.effectRunning = true;
- return (this.effectID = GTA.Native.Function.Call<int>("START_PTFX_ON_VEH", this.effectName, vehicle, offset.X, offset.Y, offset.Z, rotation.X, rotation.Y, rotation.Z, scale));
- }
- return 0;
- }
- public int StartOnVehicle(GTA.Vehicle vehicle, Vector3 offset)
- {
- return this.StartOnVehicle(vehicle, offset, Vector3.Zero, 1.0f);
- }
- public int StartOnVehicle(GTA.Vehicle vehicle)
- {
- return this.StartOnVehicle(vehicle, Vector3.Zero, Vector3.Zero, 1.0f);
- }
- public int StartOnPed(GTA.Ped ped, Vector3 offset, Vector3 rotation, float scale)
- {
- if (!this.effectRunning)
- {
- this.effectRunning = true;
- return (this.effectID = GTA.Native.Function.Call<int>("START_PTFX_ON_PED", this.effectName, ped, offset.X, offset.Y, offset.Z, rotation.X, rotation.Y, rotation.Z, scale));
- }
- return 0;
- }
- public int StartOnPed(GTA.Ped ped, Vector3 offset)
- {
- return this.StartOnPed(ped, offset, Vector3.Zero, 1.0f);
- }
- public int StartOnPed(GTA.Ped ped)
- {
- return this.StartOnPed(ped, Vector3.Zero, Vector3.Zero, 1.0f);
- }
- public int StartOnPedBone(GTA.Ped ped, GTA.Bone bone, Vector3 offset, Vector3 rotation, float scale)
- {
- if (!this.effectRunning)
- {
- this.effectRunning = true;
- return (this.effectID = GTA.Native.Function.Call<int>("START_PTFX_ON_PED_BONE", this.effectName, ped, offset.X, offset.Y, offset.Z, rotation.X, rotation.Y, rotation.Z, (int)bone, scale));
- }
- return 0;
- }
- public int StartOnPedBone(GTA.Ped ped, GTA.Bone bone, Vector3 offset)
- {
- return this.StartOnPedBone(ped, bone, offset, Vector3.Zero, 1.0f);
- }
- public int StartOnPedBone(GTA.Ped ped, GTA.Bone bone)
- {
- return this.StartOnPedBone(ped, bone, Vector3.Zero, Vector3.Zero, 1.0f);
- }
- public void Update(Vector3 position, Vector3 rotation)
- {
- if (this.effectID > 0) //if (this.effectStarted)
- GTA.Native.Function.Call("UPDATE_PTFX_OFFSETS", this.effectID, position.X, position.Y, position.Z, rotation.X, rotation.Y, rotation.Z);
- }
- public void Update(Vector3 position)
- {
- this.Update(position, Vector3.Zero);
- }
- public void Stop()
- {
- if (this.effectID > 0 && this.effectRunning) //if (this.effectStarted)
- {
- GTA.Native.Function.Call("STOP_PTFX", this.effectID);
- this.effectID = 0;
- this.effectRunning = false;
- }
- }
- #endregion
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement