Skip to content

Instantly share code, notes, and snippets.

@alexguirre
Created January 3, 2017 16:04
Show Gist options
  • Save alexguirre/e3abc1799d0515df2c699c75b9fdce21 to your computer and use it in GitHub Desktop.
Save alexguirre/e3abc1799d0515df2c699c75b9fdce21 to your computer and use it in GitHub Desktop.
// System
using System.Drawing;
// RPH
using Rage;
using Rage.Native;
internal class Decal
{
public uint Handle { get; }
public bool IsAlive { get { return NativeFunction.Natives.IsDecalAlive<bool>(Handle); } }
public Decal(DecalType type,
Vector3 position,
float p4, float p5, float p6,
float p7, float p8, float p9,
float widthScale, float heightScale,
Color color,
float liveTimeInSeconds,
bool p17, bool p18, bool p19)
{
Handle = NativeFunction.Natives.AddDecal<uint>((int)type,
position.X, position.Y, position.Z,
p4, p5, p6,
p7, p8, p9,
widthScale, heightScale,
color.R / 255.0f, color.G / 255.0f, color.B / 255.0f, color.A / 255.0f,
liveTimeInSeconds,
p17, p18, p19);
}
public Decal(DecalType type,
Vector3 position,
float widthScale, float heightScale,
Color color,
float liveTimeInSeconds)
{
Handle = NativeFunction.Natives.AddDecal<uint>((int)type,
position.X, position.Y, position.Z,
0f, 0f, -1f,
0f, 1f, 0f,
widthScale, heightScale,
color.R / 255.0f, color.G / 255.0f, color.B / 255.0f, color.A / 255.0f,
liveTimeInSeconds,
true, false, false);
}
public void Remove()
{
NativeFunction.Natives.RemoveDecal(Handle);
}
}
internal enum DecalType // decals.dat
{
// Splatters
BloodSplatters = 1010,
BloodDirectional = 1015,
BloodMist = 1017,
MudSplatters = 1020,
PaintSplatters = 1030,
WaterSplatters = 1040,
WaterHydrantDecals = 1050,
// Scripted Splatters
ScriptedBloodSplatters = 1110,
// Liquid Pools
WaterSolidPool = 9000,
BloodSolidPool = 9001,
OilSolidPool = 9002,
PretolSolidPool = 9003,
MudSolidPool = 9004,
WaterPorousPool = 9005,
BloodPorousPool = 9006,
OilPorousPool = 9007,
PretolPorousPool = 9008,
MudPorousPool = 9009,
WaterPedDripPorousPool = 9010,
// Markes
LostLogoHollow = 9100,
LostLogoSolidGrey = 9101,
LostLogoSolidWhite = 9102,
CopsLogo = 9103,
VagosLogo = 9104,
RaceGroundLogo = 9106,
RaceAirLogo = 9107,
RaceWaterLogo = 9108,
TriathlonCycleLogo = 9110,
TriathlonRunLogo = 9111,
TriathlonSwimLogo = 9112,
Helipad = 9115,
ParachuteLandingTarget = 9116,
PropMpIconShadSm = 9118,
MarkerHaloPoint = 9119,
MultiplayerLocate1 = 9120,
MultiplayerLocate2 = 9121,
MultiplayerLocate3 = 9122,
MultiplayerCreatorTrigger = 9123,
// Vehicle Badges
VehicleBadge00 = 10000,
VehicleBadge01 = 10001,
VehicleBadge02 = 10002,
VehicleBadge03 = 10003,
VehicleBadge04 = 10004,
VehicleBadge05 = 10005,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment