mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-02-04 17:50:30 +03:00
Added GetViewModel function for VScript
This commit is contained in:
parent
e4d5d946d2
commit
f8a8d49be7
@ -551,6 +551,8 @@ BEGIN_ENT_SCRIPTDESC( CBasePlayer, CBaseCombatCharacter, "The player entity." )
|
||||
DEFINE_SCRIPTFUNC_NAMED( ScriptGetEyeRight, "GetEyeRight", "Gets the player's right eye vector." )
|
||||
DEFINE_SCRIPTFUNC_NAMED( ScriptGetEyeUp, "GetEyeUp", "Gets the player's up eye vector." )
|
||||
|
||||
DEFINE_SCRIPTFUNC_NAMED( ScriptGetViewModel, "GetViewModel", "Returns the viewmodel of the specified index." )
|
||||
|
||||
//
|
||||
// Hooks
|
||||
//
|
||||
@ -7148,6 +7150,19 @@ HSCRIPT CBasePlayer::VScriptGetExpresser()
|
||||
|
||||
return hScript;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
HSCRIPT CBasePlayer::ScriptGetViewModel( int viewmodelindex )
|
||||
{
|
||||
if (viewmodelindex < 0 || viewmodelindex >= MAX_VIEWMODELS)
|
||||
{
|
||||
Warning( "GetViewModel: Invalid index '%i'\n", viewmodelindex );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return ToHScript( GetViewModel( viewmodelindex ) );
|
||||
}
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -412,6 +412,8 @@ public:
|
||||
const Vector& ScriptGetEyeForward() { static Vector vecForward; EyeVectors( &vecForward, NULL, NULL ); return vecForward; }
|
||||
const Vector& ScriptGetEyeRight() { static Vector vecRight; EyeVectors( NULL, &vecRight, NULL ); return vecRight; }
|
||||
const Vector& ScriptGetEyeUp() { static Vector vecUp; EyeVectors( NULL, NULL, &vecUp ); return vecUp; }
|
||||
|
||||
HSCRIPT ScriptGetViewModel( int viewmodelindex );
|
||||
#endif
|
||||
|
||||
// View model prediction setup
|
||||
|
Loading…
x
Reference in New Issue
Block a user