swiftly icon indicating copy to clipboard operation
swiftly copied to clipboard

feat: IRecipientFilter & DispatchParticleEffect

Open 2oaJ opened this issue 6 months ago • 2 comments

I tried to use "Memory. LoadFromSignature" to call DispatcheParticleEffect, I found that it needed "IRecipitantFilter", but I couldn't find a way to get the “RecipitantFilter” of a certain player. It would be even better if it could support CRecipientFilter, CSingleRecipientFilter, and CBroadcastRecipientFilter. my code:

[Commands.Register("test")]
public void OnTestCommand(int playerid, string[] arguments, int count, bool silent, string prefix)
{
    var player = Generic.GetPlayer(playerid);

    Memory memory = new ();
    memory.LoadFromSignature("server", "\x48\x89\x5C\x24\x08\x48\x89\x74\x24\x10\x48\x89\x7C\x24\x18\x4C\x89\x74\x24\x20\x55\x48\x8D\x6C\x24\xD1"); // windows
    var hook = Hooks.AddHook(memory, "sipssbipp", "i");

    Hooks.CallHook(hook,
                   "particles/1.vpcf",
                   (int)ParticleAttachment_t.PATTACH_POINT_FOLLOW,
                   player!.CBaseEntity().GetClassDataPtr(),// 
                   "0",
                   "",
                   false,
                   0,
                   IntPtr.Zero,//  I don't know how to get IRcipientFilter, this is a placeholder
                   0);
}

2oaJ avatar Aug 21 '25 15:08 2oaJ