Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new native rg_observer_find_next_player #325

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jonathan-up
Copy link
Contributor

@jonathan-up jonathan-up commented Jul 27, 2024

Tested✔

#include <amxmodx>
#include <reapi>

public plugin_init()
{
    register_clcmd("say .fnp", "cmd_fnp");

    RegisterHookChain(RG_CBasePlayer_Observer_FindNextPlayer, "RG_CBasePlayer_Observer_FindNextPlayer_Pre", false);
}

public RG_CBasePlayer_Observer_FindNextPlayer_Pre(const this, bool:bReverse, name[])
{
    client_print(this, print_chat, "FindNextPlayer: bReverse(%d), name(%s)", bReverse, name);
}

public cmd_fnp(const index)
{
    if (!(get_member(index, m_afPhysicsFlags) & PFLAG_OBSERVER))
    {
        client_print(index, print_chat, "YOUR ARE NOT A OBSERVER");
        return PLUGIN_HANDLED;
    }

    client_print(index, print_chat, "YOU DID");
    rg_observer_find_next_player(index, true, "");
    return PLUGIN_HANDLED;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant