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

Headless #47

Open
Taureon opened this issue Jul 13, 2021 · 2 comments
Open

Headless #47

Taureon opened this issue Jul 13, 2021 · 2 comments
Labels
request :: perk Requesting a new perk

Comments

@Taureon
Copy link

Taureon commented Jul 13, 2021

It just removes your head but you would still play normally, so gameplay-wise the only thing that would happen is that people can't headshot you for like 30 seconds

@Taureon
Copy link
Author

Taureon commented Jul 13, 2021

someone apply the perk request label because github doesnt let me for some reason

@MAGNAT2645
Copy link
Contributor

I think it is possible with SDKHooks.

public void Headless_Call(int client, RTDPerk perk, bool bEnable) {
	if ( bEnable ) {
		SDKHook( client, SDKHook_PreThinkPost, OnPlayerPreThinkPost );
		SDKHook( client, SDKHook_OnTakeDamageAlive, OnPlayerTakeDamageAlive );
	} else {
		SDKUnhook( client, SDKHook_PreThinkPost, OnPlayerPreThinkPost );
		SDKUnhook( client, SDKHook_OnTakeDamageAlive, OnPlayerTakeDamageAlive );
	}
}

public void OnPlayerPreThinkPost(int client) {
	SetEntPropFloat( client, Prop_Send, "m_flHeadScale", 0.001 );
}

public Action OnPlayerTakeDamageAlive(int victim, int& attacker, int& inflictor, float& damage, int& damagetype, int& weapon, float damageForce[3], float damagePosition[3], int damagecustom) {
	if ( damagecustom == TF_CUSTOM_HEADSHOT ) {
		damage = 0.0;
		return Plugin_Changed;
	}

	return Plugin_Continue;
}

@Phil25 Phil25 added the request :: perk Requesting a new perk label Jul 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
request :: perk Requesting a new perk
Projects
None yet
Development

No branches or pull requests

3 participants