diff --git a/extensions/sdktools/vnatives.cpp b/extensions/sdktools/vnatives.cpp index ae6c0623..f966dd7e 100644 --- a/extensions/sdktools/vnatives.cpp +++ b/extensions/sdktools/vnatives.cpp @@ -894,6 +894,28 @@ static cell_t WeaponEquip(IPluginContext *pContext, const cell_t *params) return 1; } +static cell_t ActivateEntity(IPluginContext *pContext, const cell_t *params) +{ + static ValveCall *pCall = NULL; + if (!pCall) + { + if (!CreateBaseCall("Activate", ValveCall_Entity, NULL, NULL, 0, &pCall)) + { + return pContext->ThrowNativeError("\"Activate\" not supported by this mod"); + } + else if (!pCall) + { + return pContext->ThrowNativeError("\"Activate\" wrapper failed to initialized"); + } + } + + START_CALL(); + DECODE_VALVE_PARAM(1, thisinfo, 0); + FINISH_CALL_SIMPLE(NULL); + + return 1; +} + sp_nativeinfo_t g_Natives[] = { {"ExtinguishEntity", ExtinguishEntity}, @@ -919,5 +941,6 @@ sp_nativeinfo_t g_Natives[] = {"GetPlayerDecalFile", GetPlayerDecalFile}, {"GetServerNetStats", GetServerNetStats}, {"EquipPlayerWeapon", WeaponEquip}, + {"ActivateEntity", ActivateEntity}, {NULL, NULL}, }; diff --git a/gamedata/sdktools.games.txt b/gamedata/sdktools.games.txt index 04c53078..86c9635e 100644 --- a/gamedata/sdktools.games.txt +++ b/gamedata/sdktools.games.txt @@ -337,6 +337,11 @@ "windows" "217" "linux" "218" } + "Activate" + { + "windows" "32" + "linux" "33" + } } } @@ -420,6 +425,11 @@ "windows" "217" "linux" "218" } + "Activate" + { + "windows" "32" + "linux" "33" + } } } @@ -503,6 +513,11 @@ "windows" "217" "linux" "218" } + "Activate" + { + "windows" "32" + "linux" "33" + } } } @@ -587,6 +602,11 @@ "windows" "211" "linux" "212" } + "Activate" + { + "windows" "37" + "linux" "38" + } /* Temp Entities */ "TE_GetServerClass" @@ -695,6 +715,11 @@ "windows" "220" "linux" "221" } + "Activate" + { + "windows" "32" + "linux" "33" + } /* Offset into CBaseTempEntity constructor. * On Windows Dsytopia is heavily inlined; we use the function @@ -792,6 +817,11 @@ "windows" "215" "linux" "216" } + "Activate" + { + "windows" "31" + "linux" "32" + } } } @@ -876,6 +906,11 @@ "windows" "217" "linux" "218" } + "Activate" + { + "windows" "32" + "linux" "33" + } } } @@ -950,7 +985,7 @@ "windows" "25" "linux" "26" } - + "TE_GetServerClass" { "windows" "0" @@ -1055,6 +1090,11 @@ "windows" "227" "linux" "228" } + "Activate" + { + "windows" "36" + "linux" "37" + } } "Signatures" @@ -1227,6 +1267,11 @@ "windows" "221" "linux" "222" } + "Activate" + { + "windows" "32" + "linux" "33" + } /* Offset into LevelShutdown for CGlobalEntList */ "gEntList" @@ -1326,6 +1371,11 @@ "windows" "217" "linux" "218" } + "Activate" + { + "windows" "32" + "linux" "33" + } } } @@ -1410,6 +1460,11 @@ "windows" "217" "linux" "218" } + "Activate" + { + "windows" "32" + "linux" "33" + } } } @@ -1484,7 +1539,11 @@ "windows" "25" "linux" "26" } - + "Activate" + { + "windows" "32" + "linux" "33" + } "TE_GetServerClass" { "windows" "0" @@ -1597,6 +1656,11 @@ "windows" "198" "linux" "199" } + "Activate" + { + "windows" "32" + "linux" "33" + } } "Signatures" @@ -1721,6 +1785,11 @@ "windows" "219" "linux" "220" } + "Activate" + { + "windows" "32" + "linux" "33" + } } "Signatures" { diff --git a/plugins/include/sdktools_functions.inc b/plugins/include/sdktools_functions.inc index efcd3a50..1d6d0eb3 100644 --- a/plugins/include/sdktools_functions.inc +++ b/plugins/include/sdktools_functions.inc @@ -289,7 +289,6 @@ native bool:GetPlayerDecalFile(client, String:hex[], maxlength); */ native GetServerNetStats(&Float:in, &Float:out); - /** * Equip's a player's weapon. * @@ -300,3 +299,12 @@ native GetServerNetStats(&Float:in, &Float:out); * game. */ native EquipPlayerWeapon(client, weapon); + +/** + * Activates an entity (CBaseAnimating::Activate) + * + * @param entity Entity index. + * @noreturn + * @error Invalid entity or lack of mod support. + */ +native ActivateEntity(entity);