Skip to content

Implement CSGameRules::PlayerRelationship hook #355

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

JUNESYNGOTOFLEX
Copy link

@JUNESYNGOTOFLEX JUNESYNGOTOFLEX commented Jun 10, 2025

custom scenario

#include <amxmodx>
#include <reapi>

const GR_UGLY    = 1337;

public plugin_init()
{
	RegisterHookChain(RG_CSGameRules_PlayerRelationship, "CSGameRules_PlayerRelationship", false);
}

public function(player1, player2)
{
	if (rg_player_relationship(player1, player2) == GR_UGLY)
	{
		client_print(0, print_chat, "Custom relation between %n and %n", player1, player2);
	}
}

public CSGameRules_PlayerRelationship(const pPlayer, const pEntity)
{
	// Not a player
	if (!is_user_connected(pEntity)) {
		return HC_CONTINUE;
	}
	
	if (pEntity == 2)
	{
		SetHookChainReturn(ATYPE_INTEGER, GR_UGLY);
		return HC_SUPERCEDE;
	}
	
	return HC_CONTINUE;
}

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