extensions/sdktools/vnatives.cpp
changeset 4004 91974ce16453
parent 3997 59bcfc51eb79
child 4010 e32d0f63c41b
     1.1 --- a/extensions/sdktools/vnatives.cpp	Mon Aug 12 01:33:04 2013 +0100
     1.2 +++ b/extensions/sdktools/vnatives.cpp	Mon Aug 12 02:08:34 2013 +0100
     1.3 @@ -1073,6 +1073,32 @@
     1.4  	return 1;
     1.5  }
     1.6  
     1.7 +static cell_t GetPlayerJingleFile(IPluginContext *pContext, const cell_t *params)
     1.8 +{
     1.9 +	IGamePlayer *player = playerhelpers->GetGamePlayer(params[1]);
    1.10 +	if (player == NULL)
    1.11 +	{
    1.12 +		return pContext->ThrowNativeError("Invalid client index %d", params[1]);
    1.13 +	}
    1.14 +	if (!player->IsInGame())
    1.15 +	{
    1.16 +		return pContext->ThrowNativeError("Client %d is not in game", params[1]);
    1.17 +	}
    1.18 +
    1.19 +	player_info_t info;
    1.20 +	char *buffer;
    1.21 +
    1.22 +	if (!GetPlayerInfo(params[1], &info) || !info.customFiles[1])
    1.23 +	{
    1.24 +		return 0;
    1.25 +	}
    1.26 +
    1.27 +	pContext->LocalToString(params[2], &buffer);
    1.28 +	Q_binarytohex((byte *)&info.customFiles[1], sizeof(info.customFiles[1]), buffer, params[3]);
    1.29 +
    1.30 +	return 1;
    1.31 +}
    1.32 +
    1.33  static cell_t GetServerNetStats(IPluginContext *pContext, const cell_t *params)
    1.34  {
    1.35  	if (iserver == NULL)
    1.36 @@ -1256,6 +1282,7 @@
    1.37  	{"GetClientAimTarget",		sm_GetClientAimTarget},
    1.38  	{"SetEntityModel",			sm_SetEntityModel},
    1.39  	{"GetPlayerDecalFile",		GetPlayerDecalFile},
    1.40 +	{"GetPlayerJingleFile",		GetPlayerJingleFile},
    1.41  	{"GetServerNetStats",		GetServerNetStats},
    1.42  	{"EquipPlayerWeapon",		WeaponEquip},
    1.43  	{"ActivateEntity",			ActivateEntity},