View Single Post
SHUFEN
Senior Member
Join Date: Jun 2014
Location: Japan, Tokyo
Old 08-20-2018 , 01:17   Re: [CS:GO] Reselecting grenades after throwing one
Reply With Quote #4

You can use this logic to force the equipping.

Code:
Handle g_hSwitchWeaponCall = null;

public void OnPluginStart()
{
	Handle hGameData = LoadGameConfigFile("sdkhooks.games");
	StartPrepSDKCall(SDKCall_Player);
	PrepSDKCall_SetFromConf(hGameData, SDKConf_Virtual, "Weapon_Switch");
	PrepSDKCall_AddParameter(SDKType_CBaseEntity, SDKPass_Pointer);
	PrepSDKCall_AddParameter(SDKType_PlainOldData, SDKPass_Plain);
	g_hSwitchWeaponCall = EndPrepSDKCall();
	delete hGameData;
}

void YourFunction(int client, int weapon)
{
	SDKCall(g_hSwitchWeaponCall, client, weapon, 0);
	SetEntPropEnt(client, Prop_Send, "m_hActiveWeapon", weapon);
}
SHUFEN is offline
Send a message via Skype™ to SHUFEN