Raised This Month: $ Target: $400
 0% 

Weapon Pickup Block


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 08-04-2010 , 22:34   Re: Weapon Pickup Block
Reply With Quote #1

I saw you looked into it before (I stalked your profile) so you should know how to just block it. Loop through all players and if player has the bool set true, block, else don't.

Simple as that. I'm just too lazy to check up the actual code.


Edit: You could try this:
PHP Code:
#include < amxmodx >
#include < hamsandwich >

public plugin_init( ) {
    
register_plugin"No Weapon Pickup""1.0""xPaw" );
    
    
RegisterHamHam_Touch"weaponbox""FwdHamPlayerWeaponTouch" );
    
RegisterHamHam_Touch"armoury_entity""FwdHamPlayerWeaponTouch" );
}

public 
FwdHamPlayerWeaponTouch( const iEntity, const id )
    return 
g_LastRequest HAM_SUPERCEDE HAM_IGNORED
__________________

Last edited by DarkGod; 08-04-2010 at 23:04.
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 08-04-2010 , 22:40   Re: Weapon Pickup Block
Reply With Quote #2

Quote:
Originally Posted by DarkGod View Post
I saw you looked into it before (I stalked your profile) so you should know how to just block it. Loop through all players and if player has the bool set true, block, else don't.

Simple as that. I'm just too lazy to check up the actual code.
I'm not exactly sure how to go about it. If someone could possibly "help" me (give me the code) i would love them.
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 08-04-2010 , 22:47   Re: Weapon Pickup Block
Reply With Quote #3

Quote:
Originally Posted by DarkGod View Post
I saw you looked into it before (I stalked your profile) so you should know how to just block it. Loop through all players and if player has the bool set true, block, else don't.

Simple as that. I'm just too lazy to check up the actual code.


Edit: You could try this:
PHP Code:
#include <amxmodx>
#include <hamsandwich>

new bool:CanPickup[33] = true

public plugin_init()
{
    
register_plugin"Block Weapon Pickup""1.0""Wrecked" )
    
    new 
classname[20// weapon_smokegrenade (19) + 1
    
    
for( new CSW_P228<= CSW_P90i++ )
    {
        if ( 
get_weaponnameiclassnamecharsmaxclassname ) ) )
        {
            
RegisterHamHam_Item_Deployclassname"HamItemDeployPre")
            
/* Other forwards that you could've used:
                * Ham_AddPlayerItem
                * Ham_Item_CanDeploy
                * Ham_Touch
            */
        
}
    }
}

public 
HamItemDeployPreweapon )
{
    new 
players[32], numindex
    get_players
(playersnum)
    
    for(new 
inumi++)
    {
        
index players[i]
        
        if(!
CanPickup[index])
            return 
HAM_SUPERCEDE// blocks function call
    
}
    
    return 
HAM_IGNORED

Nothing I've tried has worked. It's pissing me off.

PHP Code:
public HamItemDeployPreweapon )
{
    new 
players[32], num;
    
get_players(playersnum)
    
    for(new 
inumi++)
    {
        if( 
gLastRequest )
        {
            return 
HAM_SUPERCEDE;
        }
    }
    
    return 
HAM_IGNORED

__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX 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 00:08.


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