public CSGameRules_GetPlayerSpawnSpot(const pPlayer)
{
DisableHookChain(g_hGetPlayerSpawnSpot)
new pBot = g_aPlayerData[pPlayer][pBotIndex]
if(pBot > 0 && !is_nullent(pBot))
{
-- new Float:vecOrigin[coord_e], Float:vecVAngles[coord_e], Float:vecMins[coord_e], Float:vecMaxs[coord_e]
++ new Float:vecOrigin[coord_e], Float:vecVAngles[coord_e], Float:vecMins[coord_e], Float:vecMaxs[coord_e], Float:vecVelocity[coord_e]
get_entvar(pBot, var_origin, vecOrigin)
++ get_entvar(pBot, var_velocity, vecVelocity)
get_entvar(pBot, var_v_angle, vecVAngles) // note: v_angle
get_entvar(pBot, var_mins, vecMins)
get_entvar(pBot, var_maxs, vecMaxs)
TransferItems(pBot, pPlayer)
KillBot(pBot, vecOrigin)
-- if(SetPlayerPosition(pPlayer, vecOrigin, vecVAngles, vecMins, vecMaxs, (get_entvar(pBot, var_flags) & FL_DUCKING) ? HULL_HEAD : HULL_HUMAN))
++ if(SetPlayerPosition(pPlayer, vecOrigin, vecVAngles, vecMins, vecMaxs, vecVelocity, (get_entvar(pBot, var_flags) & FL_DUCKING) ? HULL_HEAD : HULL_HUMAN))
{
SetHookChainReturn(ATYPE_INTEGER, pPlayer)
return HC_SUPERCEDE
}
}
return HC_CONTINUE
}
--bool:SetPlayerPosition(const pPlayer, Float:vecOrigin[coord_e], Float:vecAngles[coord_e], Float:vecMins[coord_e], Float:vecMaxs[coord_e], const iHullNumber)
++bool:SetPlayerPosition(const pPlayer, Float:vecOrigin[coord_e], Float:vecAngles[coord_e], Float:vecMins[coord_e], Float:vecMaxs[coord_e], Float:vecVelocity[coord_e], const iHullNumber)
{
static const Float:vecMove[][coord_e] = { { 1.0, 1.0, 0.0 }, { 1.0, -1.0, 0.0 }, { -1.0, -1.0, 0.0 }, { -1.0, 1.0, 0.0 } }
new i
do
{
if(IsFreeSpace(vecOrigin, iHullNumber))
{
if(iHullNumber == HULL_HEAD)
{
set_entvar(pPlayer, var_flags, get_entvar(pPlayer, var_flags) | FL_DUCKING)
set_entvar(pPlayer, var_button, get_entvar(pPlayer, var_button) | IN_DUCK)
}
SET_SIZE(pPlayer, vecMins, vecMaxs)
SET_ORIGIN(pPlayer, vecOrigin)
-- set_entvar(pPlayer, var_velocity, VECTOR_ZERO)
++ set_entvar(pPlayer, var_velocity, vecVelocity)
// set_entvar(pPlayer, var_basevelocity, VECTOR_ZERO)
set_entvar(pPlayer, var_v_angle, VECTOR_ZERO)
set_entvar(pPlayer, var_angles, vecAngles)
set_entvar(pPlayer, var_punchangle, VECTOR_ZERO)
set_entvar(pPlayer, var_fixangle, 1) // const FORCE_VIEW_ANGLES = 1
return true
}
else
{
vecOrigin[X] = (vecOrigin[X] - vecMins[X] * vecMove[X])
vecOrigin[Y] = (vecOrigin[Y] - vecMins[Y] * vecMove[Y])
i++
}
// server_print("Attemps: %i", i)
} while (i < sizeof(vecMove))
return false
}