CounterStrikeSharp icon indicating copy to clipboard operation
CounterStrikeSharp copied to clipboard

[NeedHelp] Not possible to spawn a decal dynamically?

Open joleman11 opened this issue 1 year ago • 1 comments

Non-working pseudocode:

CProjectedDecal decalEnt = Utilities.CreateEntityByName<CProjectedDecal>("info_projecteddecal");
decalEnt.Texture = 0 // How do you get/set the texture id?
decalEnt.Distance = 64.0f;
decalEnt.Teleport(
    new Vector(
        pawn!.AbsOrigin!.X,
        pawn!.AbsOrigin!.Y,
        pawn!.AbsOrigin!.Z
    ),
    pawn!.EyeAngles,
    new Vector(0.0f, 0.0f, 0.0f)
);
decalEnt.DispatchSpawn(); // Crashes server instantly
decalEnt.AcceptInput("Activate"); // Needed in the hammer editor for the decal to appear.

joleman11 avatar Jun 15 '24 07:06 joleman11

not sure if related but might work with #615

KillStr3aK avatar Oct 10 '24 12:10 KillStr3aK