Added EquipPlayerWeapon to SDKTools. Offsets for CS:S and TF2 added.

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401975
This commit is contained in:
Matt Woodrow
2008-04-01 00:51:21 +00:00
parent b9bd1b1037
commit fbe46934a4
4 changed files with 80 additions and 0 deletions
+24
View File
@@ -871,6 +871,29 @@ static cell_t GetServerNetStats(IPluginContext *pContext, const cell_t *params)
return 1;
}
static cell_t WeaponEquip(IPluginContext *pContext, const cell_t *params)
{
static ValveCall *pCall = NULL;
if (!pCall)
{
ValvePassInfo pass[1];
InitPass(pass[0], Valve_CBaseEntity, PassType_Basic, PASSFLAG_BYVAL);
if (!CreateBaseCall("WeaponEquip", ValveCall_Player, NULL, pass, 1, &pCall))
{
return pContext->ThrowNativeError("\"WeaponEquip\" not supported by this mod");
} else if (!pCall) {
return pContext->ThrowNativeError("\"WeaponEquip\" wrapper failed to initialized");
}
}
START_CALL();
DECODE_VALVE_PARAM(1, thisinfo, 0);
DECODE_VALVE_PARAM(2, vparams, 0);
FINISH_CALL_SIMPLE(NULL);
return 1;
}
sp_nativeinfo_t g_Natives[] =
{
{"ExtinguishEntity", ExtinguishEntity},
@@ -895,5 +918,6 @@ sp_nativeinfo_t g_Natives[] =
{"SetEntityModel", sm_SetEntityModel},
{"GetPlayerDecalFile", GetPlayerDecalFile},
{"GetServerNetStats", GetServerNetStats},
{"EquipPlayerWeapon", WeaponEquip},
{NULL, NULL},
};