Raised This Month: $ Target: $400
 0% 

WeapPickup not working!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
supertrio17
Senior Member
Join Date: May 2020
Location: Serbia
Old 07-06-2020 , 15:12   Re: WeapPickup not working!
Reply With Quote #1

Quote:
Originally Posted by HamletEagle View Post
Using WeapPickup for this is a poor solution. You should hook Ham_Touch with weaponbox/armoury_entity, check if they contain an AWP and if so, block.
How do you check that?
For weaponbox entity: Check m_rgpPlayerItems offset(the CWeaponBox offset, not CBasePlayer), slot 1 with get_pdata_cbase. If if returns a valid entity, retrieve the classname with pev_classname and compare it with weapon_awp. If you need more details about this, search, you will find a ton of examples.
For armoury_entity read here: https://forums.alliedmods.net/showthread.php?t=250922
PHP Code:
public OnPlayerTouchWeaponBox(entid)
{
    new 
iId cs_get_weapon_id(ent);
    if( 
iId == CSW_AWP )
    {
        if(
equali(g_mapname"de_dust2_2x2") || equali(g_mapname"de_dust2_long"))
        {
            
console_cmd(id,"drop weapon_awp");
            
CC_SendMessage(id"&x01>> &x04AWP je zabranjen na malim mapama!");
        }
        else if(
g_HasVIP[id] != 1)
        {
            
console_cmd(id,"drop weapon_awp");
            
CC_SendMessage(id"&x01>> &x04AWP je zabranjen na malim mapama!");
        }
    }

I tried something like this, but it doesn't work
__________________
Contact! || Discord:
Mr_Boopsy_#2066
supertrio17 is offline
Reply



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 17:02.


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