PDA

View Full Version : [TF2] Function to update player's hitboxes


Michalplyoutube
10-17-2014, 12:24
I can't find an function like that is there any?
because i have troubles with proper hitboxes

Pelipoika
10-17-2014, 12:26
stock UpdatePlayerHitbox(const client, const Float:fScale)
{
static const Float:vecTF2PlayerMin[3] = { -24.5, -24.5, 0.0 }, Float:vecTF2PlayerMax[3] = { 24.5, 24.5, 83.0 };

decl Float:vecScaledPlayerMin[3], Float:vecScaledPlayerMax[3];

vecScaledPlayerMin = vecTF2PlayerMin;
vecScaledPlayerMax = vecTF2PlayerMax;

ScaleVector(vecScaledPlayerMin, fScale);
ScaleVector(vecScaledPlayerMax, fScale);

SetEntPropVector(client, Prop_Send, "m_vecSpecifiedSurroundingMins", vecScaledPlayerMin);
SetEntPropVector(client, Prop_Send, "m_vecSpecifiedSurroundingMaxs", vecScaledPlayerMax);
}

ex. Players m_flModelScale is 1.7: UpdatePlayerHitbox(client, 1.7);

Michalplyoutube
10-17-2014, 12:35
// D:\TF2Server\server\tf\addons\sourcemod\scrip ting\tf2bwr.sp(1397) : error 017
: undefined symbol "client"
// D:\TF2Server\server\tf\addons\sourcemod\scrip ting\tf2bwr.sp(1425) : error 017
: undefined symbol "client"
// D:\TF2Server\server\tf\addons\sourcemod\scrip ting\tf2bwr.sp(1433) : error 017
: undefined symbol "client"
// D:\TF2Server\server\tf\addons\sourcemod\scrip ting\tf2bwr.sp(1873) : error 017
: undefined symbol "client"

What i did wrong?

Chdata
10-17-2014, 13:03
You're trying to use a variable named 'client' without defining it first.

(As the error says, client is undefined).

Michalplyoutube
10-17-2014, 13:33
So i will talk to pelipoika soon i have

friagram
10-17-2014, 14:15
changing specified vecs will only change the bounds at which NORMAL HITBOXES will be tested. If the hitboxes of the model are too large for the stock bounds, making them bigger will allow the hitboxes to be extended and work properly. However, if the model's hitboxes already fit inside of that bounds -- nothing will happen. Likewise, making the specified vecs smaller than the model's hitboxes will decrease the attack surface you have on the model.