Raised This Month: $ Target: $400
 0% 

Ham_Touch,can pick up only:m3,elite and other.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
SchlumPF*
Veteran Member
Join Date: Mar 2007
Old 12-21-2008 , 13:18   Re: Ham_Touch,can pick up only:m3,elite and other.
Reply With Quote #9

Quote:
Originally Posted by xbatista View Post
Compiles bad...fwd_touch should return a value and a value that is never used: "plr"
sry made a couple of mistakes cuz i had to hurry :/ this should work now

PHP Code:
#include <amxmodx>
#include <fakemeta>

new g_AllowedWeapons[][] =
{
    
"weapon_mac10",
    
"weapon_elite",
    
"weapon_m3",
    
"weapon_m4a1"
}

new 
g_iMaxPlayers;

public 
plugin_init( )
{
    
register_forwardFM_Touch"fwdTouch" );
    
g_iMaxPlayers get_maxplayers( );
}

// the plr can touch the ent AND the ent can touch the player so we need to supercede both
public fwdTouchtouchedtoucher )
{
    static 
ent;

    
// find out whether the toucher or touched is the plr
    
if( toucher <= g_iMaxPlayers )
        
ent touched;
    else if( 
touched <= g_iMaxPlayers )
        
ent toucher;
    else 
// an ent touched an ent, no plr is involved
        
return FMRES_IGNORED;
    
    static 
classname[32];
    
peventpev_classnameclassname31 );
    
    
// check the ent for it's classname
    
if( equalclassname"weapon_") )
    {
        for(new 
i;sizeof(g_AllowedWeapons);i++)
        {
            if( 
equalclassname[7], g_AllowedWeapons[i][7] ) )
            {
                return 
FMRES_IGNORED;
            }
            
            return 
FMRES_SUPERCEDE;
        }
    }
    
    return 
FMRES_IGNORED;

__________________
SchlumPF* is offline
Send a message via ICQ to SchlumPF*
 



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:06.


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