Telemenu: Add the ability to save the view and use it during teleportation

This commit is contained in:
Freeman-AM 2014-05-18 15:58:53 +02:00
parent 9c93cd1283
commit 7007105150

View File

@ -42,6 +42,7 @@ new g_menuPlayers[MAX_PLAYERS][32]
new g_menuPlayersNum[MAX_PLAYERS] new g_menuPlayersNum[MAX_PLAYERS]
new g_menuOption[MAX_PLAYERS] = {-1, ...} new g_menuOption[MAX_PLAYERS] = {-1, ...}
new Float:g_menuOrigin[MAX_PLAYERS][3] new Float:g_menuOrigin[MAX_PLAYERS][3]
new Float:g_menuVAngle[MAX_PLAYERS][3]
new g_coloredMenus new g_coloredMenus
public plugin_init() public plugin_init()
@ -70,6 +71,7 @@ public actionTelMenu(id, key)
g_menuOption[id] = 0 g_menuOption[id] = 0
pev(id, pev_origin, g_menuOrigin[id]) pev(id, pev_origin, g_menuOrigin[id])
pev(id, pev_v_angle, g_menuVAngle[id])
displayTelMenu(id, g_menuPosition[id]) displayTelMenu(id, g_menuPosition[id])
} }
case 8: displayTelMenu(id, ++g_menuPosition[id]) case 8: displayTelMenu(id, ++g_menuPosition[id])
@ -92,12 +94,17 @@ public actionTelMenu(id, key)
{ {
set_pev(player, pev_flags, pev(player, pev_flags) | FL_DUCKING) set_pev(player, pev_flags, pev(player, pev_flags) | FL_DUCKING)
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_fixangle, 1)
} else { } else {
new Float:f_origin[3] new Float:f_origin[3], Float:f_vangle[3]
pev(id, pev_origin, f_origin) pev(id, pev_origin, f_origin)
pev(id, pev_v_angle, f_vangle)
set_pev(player, pev_flags, pev(player, pev_flags) | FL_DUCKING) set_pev(player, pev_flags, pev(player, pev_flags) | FL_DUCKING)
engfunc(EngFunc_SetOrigin, player, f_origin) engfunc(EngFunc_SetOrigin, player, f_origin)
set_pev(player, pev_angles, f_vangle)
set_pev(player, pev_fixangle, 1)
} }
new authid[32], authid2[32], name[32] new authid[32], authid2[32], name[32]