View Single Post
Author Message
manicogaming
AlliedModders Donor
Join Date: Aug 2014
Old 05-27-2023 , 15:45   [CS:GO] Disabling weapon pickup
Reply With Quote #1

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 clientint iWeapon)
{
    if(
eItems_GetWeaponSlotByWeapon(iWeapon) != CS_SLOT_PRIMARY)
        return 
Plugin_Continue;

    
int iPrimary GetPlayerWeaponSlot(clientCS_SLOT_PRIMARY);
    if(!
IsValidEntity(iPrimary))
        return 
Plugin_Continue;
    
    
int iDroppedDefIndex GetEntProp(iWeaponProp_Send"m_iItemDefinitionIndex");
    
int iRifleDefIndex GetEntProp(iPrimaryProp_Send"m_iItemDefinitionIndex");
    
    if(
iRifleDefIndex == || (iRifleDefIndex == 60 && (iDroppedDefIndex != || iDroppedDefIndex != 7)))
        return 
Plugin_Handled
    
    return 
Plugin_Continue;

__________________
manicogaming is offline