|
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
|
01-16-2015
, 21:34
Re: [TF2] Get Weapon Index & Variable Declarations
|
#2
|
Spoiler
PHP Code:
stock GetIndexOfWeaponSlot(iClient, iSlot) { return GetWeaponIndex(GetPlayerWeaponSlot(iClient, iSlot)); }
stock GetClientCloakIndex(iClient) { return GetWeaponIndex(GetPlayerWeaponSlot(iClient, TFWeaponSlot_Watch)); }
stock GetWeaponIndex(iWeapon) { return IsValidEnt(iWeapon) ? GetEntProp(iWeapon, Prop_Send, "m_iItemDefinitionIndex"):-1; }
stock GetActiveIndex(iClient) { return GetWeaponIndex(GetEntPropEnt(iClient, Prop_Send, "m_hActiveWeapon")); }
stock bool:IsWeaponSlotActive(iClient, iSlot) { return GetPlayerWeaponSlot(iClient, iSlot) == GetEntPropEnt(iClient, Prop_Send, "m_hActiveWeapon"); }
stock bool:IsIndexActive(iClient, iIndex) { return iIndex == GetWeaponIndex(GetEntPropEnt(iClient, Prop_Send, "m_hActiveWeapon")); }
stock bool:IsSlotIndex(iClient, iSlot, iIndex) { return iIndex == GetIndexOfWeaponSlot(iClient, iSlot); }
stock bool:IsValidEnt(iEnt) { return iEnt > MaxClients && IsValidEntity(iEnt); }
stock GetSlotFromPlayerWeapon(iClient, iWeapon) { for (new i = 0; i <= 5; i++) { if (iWeapon == GetPlayerWeaponSlot(iClient, i)) { return i; } } return -1; }
__________________
|
|
|
|