Raised This Month: $51 Target: $400
 12% 

[CS:GO] Disabling weapon pickup


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:03.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode