RTD
RTD copied to clipboard
Headless
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
someone apply the perk request label because github doesnt let me for some reason
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;
}