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

[CSGO] Axe and hammer pick up


Post New Thread Reply   
 
Thread Tools Display Modes
SOBgaming
Senior Member
Join Date: Jul 2015
Old 03-12-2019 , 09:24   Re: [CSGO] Axe and hammer pick up
Reply With Quote #21

I think there's no server vars for that, how would you go about making the knife, spanner, axe, etc. Drop on death and allow 'E' to work to pick it up?

Quote:
Originally Posted by Trsak View Post
What would be the best way to block weapon_melee throwing and make ATTACK2 act just like ATTACK?
There's a plugin that allows you to block ATTACK1 on knives, probably not so different from blocking ATTACK2.
__________________

Last edited by SOBgaming; 03-12-2019 at 09:25.
SOBgaming is offline
emvaized
Junior Member
Join Date: Aug 2021
Old 09-15-2021 , 22:20   Re: [CSGO] Axe and hammer pick up
Reply With Quote #22

Quote:
Originally Posted by Papero View Post
This will make you pickup all the new melee weapons.
Note that this is intended to be used with mp_drop_knife_enable set to 1, or you won't be able to drop your knife to pickup a dropped axe/wrench/hammer.
PHP Code:
public void OnPluginStart()
{
    
//Lateload
    
for (int i 1<= MaxClientsi++) if (IsClientInGame(i)) OnClientPutInServer(i);
}

public 
void OnClientPutInServer(int client)
{
    
SDKHook(clientSDKHook_WeaponCanUseHook_WeaponCanUse);
}

public 
Action Hook_WeaponCanUse(int clientint weapon)
{
    
char classname[64];
    
GetEntityClassname(weaponclassnamesizeof classname);
    
    if (
StrEqual(classname"weapon_melee") && !(HasWeapon(client"weapon_melee") || HasWeapon(client"weapon_knife")))
        
EquipPlayerWeapon(clientweapon);
}

stock bool HasWeapon(int client, const char[] classname)
{
    
int index;
    
int weapon;
    
char sName[64];
    
    while((
weapon GetNextWeapon(clientindex)) != -1)
    {
        
GetEdictClassname(weaponsNamesizeof(sName));
        if (
StrEqual(sNameclassname))
            return 
true;
    }
    return 
false;
}

stock int GetNextWeapon(int clientint &weaponIndex)
{
    static 
int weaponsOffset = -1;
    if (
weaponsOffset == -1)
        
weaponsOffset FindDataMapInfo(client"m_hMyWeapons");
    
    
int offset weaponsOffset + (weaponIndex 4);
    
    
int weapon;
    while (
weaponIndex 48
    {
        
weaponIndex++;
        
        
weapon GetEntDataEnt2(clientoffset);
        
        if (
IsValidEdict(weapon)) 
            return 
weapon;
        
        
offset += 4;
    }
    
    return -
1;

I've attached another plugin, if you'd like to play with the breaching charges throwing more than 3 at the same time, just use sm_breaches and it will fill you breach charge amount.
Is it something on my server, or it doesn't work with bots? They still couldn't grab the melee weapons, while living players can

Last edited by emvaized; 09-15-2021 at 22:21. Reason: Clarification
emvaized is offline
Reply


Thread Tools
Display Modes

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 07:01.


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