roflmuffin / CounterStrikeSharp

CounterStrikeSharp allows you to write server plugins in C# for Counter-Strike 2/Source2/CS2
https://docs.cssharp.dev
Other
812 stars 130 forks source link

[NeedHelp] Not possible to spawn a decal dynamically? #500

Open joleman11 opened 5 months ago

joleman11 commented 5 months ago

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.
KillStr3aK commented 1 month ago

not sure if related but might work with #615