mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-26 14:55:36 +03:00
Telemenu: Fix view_ofs not correctly set at teleportation
This commit is contained in:
parent
d3bae33c64
commit
44b4ff6f05
@ -101,8 +101,37 @@ public actionTelMenu(id, key)
|
|||||||
|
|
||||||
if (g_menuOption[id] > 0)
|
if (g_menuOption[id] > 0)
|
||||||
{
|
{
|
||||||
if (HasInDuckingStateSaved(id))
|
if ( HasInDuckingStateSaved(id) )
|
||||||
set_pev(player, pev_flags, pev(player, pev_flags) | FL_DUCKING)
|
{
|
||||||
|
new sz_modname[16]
|
||||||
|
|
||||||
|
get_modname(sz_modname, charsmax(sz_modname))
|
||||||
|
if (equal(sz_modname, "cstrike") // Counter-Strike 1.6
|
||||||
|
|| equal(sz_modname, "czero") // Counter-Strike: Condition Zero
|
||||||
|
|| equal(sz_modname, "valve") // Half-Life
|
||||||
|
|| equal(sz_modname, "tfc") // Team Fortress Classic
|
||||||
|
|| equal(sz_modname, "gearbox")) // Half-Life: Opposing Force
|
||||||
|
{
|
||||||
|
set_pev(player, pev_flags, pev(player, pev_flags) | FL_DUCKING)
|
||||||
|
set_pev(id, pev_view_ofs, {0.0, 0.0, 12.0})
|
||||||
|
}
|
||||||
|
else if (equal(sz_modname, "dod")) // Day of Defeat
|
||||||
|
{
|
||||||
|
set_pev(player, pev_flags, pev(player, pev_flags) | FL_DUCKING)
|
||||||
|
set_pev(id, pev_view_ofs, {0.0, 0.0, 18.0})
|
||||||
|
}
|
||||||
|
else if (equal(sz_modname, "ns")) // Natural Selection
|
||||||
|
{
|
||||||
|
set_pev(player, pev_flags, pev(player, pev_flags) | FL_DUCKING)
|
||||||
|
// Natural Selection handle view_ofs by itself
|
||||||
|
}
|
||||||
|
else if (equal(sz_modname, "ts")) // The Specialists
|
||||||
|
{
|
||||||
|
set_pev(player, pev_flags, pev(player, pev_flags) | FL_DUCKING)
|
||||||
|
set_pev(id, pev_view_ofs, {0.0, 0.0, 16.0})
|
||||||
|
}
|
||||||
|
// Don't add this feature for mods that we don't know how their view_ofs work
|
||||||
|
}
|
||||||
engfunc(EngFunc_SetOrigin, player, g_menuOrigin[id])
|
engfunc(EngFunc_SetOrigin, player, g_menuOrigin[id])
|
||||||
set_pev(player, pev_angles, g_menuVAngle[id])
|
set_pev(player, pev_angles, g_menuVAngle[id])
|
||||||
set_pev(player, pev_fixangle, 1)
|
set_pev(player, pev_fixangle, 1)
|
||||||
@ -111,8 +140,37 @@ public actionTelMenu(id, key)
|
|||||||
|
|
||||||
pev(id, pev_origin, f_origin)
|
pev(id, pev_origin, f_origin)
|
||||||
pev(id, pev_v_angle, f_vangle)
|
pev(id, pev_v_angle, f_vangle)
|
||||||
if (HasInDuckingStateSaved(id))
|
if ( HasInDuckingStateSaved(id) )
|
||||||
set_pev(player, pev_flags, pev(player, pev_flags) | FL_DUCKING)
|
{
|
||||||
|
new sz_modname[16]
|
||||||
|
|
||||||
|
get_modname(sz_modname, charsmax(sz_modname))
|
||||||
|
if (equal(sz_modname, "cstrike") // Counter-Strike 1.6
|
||||||
|
|| equal(sz_modname, "czero") // Counter-Strike: Condition Zero
|
||||||
|
|| equal(sz_modname, "valve") // Half-Life
|
||||||
|
|| equal(sz_modname, "tfc") // Team Fortress Classic
|
||||||
|
|| equal(sz_modname, "gearbox")) // Half-Life: Opposing Force
|
||||||
|
{
|
||||||
|
set_pev(player, pev_flags, pev(player, pev_flags) | FL_DUCKING)
|
||||||
|
set_pev(id, pev_view_ofs, {0.0, 0.0, 12.0})
|
||||||
|
}
|
||||||
|
else if (equal(sz_modname, "dod")) // Day of Defeat
|
||||||
|
{
|
||||||
|
set_pev(player, pev_flags, pev(player, pev_flags) | FL_DUCKING)
|
||||||
|
set_pev(id, pev_view_ofs, {0.0, 0.0, 18.0})
|
||||||
|
}
|
||||||
|
else if (equal(sz_modname, "ns")) // Natural Selection
|
||||||
|
{
|
||||||
|
set_pev(player, pev_flags, pev(player, pev_flags) | FL_DUCKING)
|
||||||
|
// Natural Selection handle view_ofs by itself
|
||||||
|
}
|
||||||
|
else if (equal(sz_modname, "ts")) // The Specialists
|
||||||
|
{
|
||||||
|
set_pev(player, pev_flags, pev(player, pev_flags) | FL_DUCKING)
|
||||||
|
set_pev(id, pev_view_ofs, {0.0, 0.0, 16.0})
|
||||||
|
}
|
||||||
|
// Don't add this feature for mods that we don't know how their view_ofs work
|
||||||
|
}
|
||||||
engfunc(EngFunc_SetOrigin, player, f_origin)
|
engfunc(EngFunc_SetOrigin, player, f_origin)
|
||||||
set_pev(player, pev_angles, f_vangle)
|
set_pev(player, pev_angles, f_vangle)
|
||||||
set_pev(player, pev_fixangle, 1)
|
set_pev(player, pev_fixangle, 1)
|
||||||
|
Loading…
Reference in New Issue
Block a user