Raised This Month: $ Target: $400
 0% 

Weapon Pickup Block


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 08-04-2010 , 22:47   Re: Weapon Pickup Block
Reply With Quote #4

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
 



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