I'm trying to make it so that a BOT can't pick up any other primary when they have the AWP and only pickup the AWP or AK-47 when they have the M4A1-S but this code that I wrote for it doesn't seem to work properly, is there anything I'm doing wrong?
PHP Code:
public Action OnWeaponCanUse(int client, int iWeapon)
{
if(eItems_GetWeaponSlotByWeapon(iWeapon) != CS_SLOT_PRIMARY)
return Plugin_Continue;
int iPrimary = GetPlayerWeaponSlot(client, CS_SLOT_PRIMARY);
if(!IsValidEntity(iPrimary))
return Plugin_Continue;
int iDroppedDefIndex = GetEntProp(iWeapon, Prop_Send, "m_iItemDefinitionIndex");
int iRifleDefIndex = GetEntProp(iPrimary, Prop_Send, "m_iItemDefinitionIndex");
if(iRifleDefIndex == 9 || (iRifleDefIndex == 60 && (iDroppedDefIndex != 9 || iDroppedDefIndex != 7)))
return Plugin_Handled;
return Plugin_Continue;
}
__________________