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 , 12:28   Re: Ham_Touch,can pick up only:m3,elite and other.
Reply With Quote #6

hleV your way did not block the ent touching the plr, only the plr touching the ent + you superceded the plr tocuhing everything except the weapons you listed
im sure there is a better way with hamsandwich but i would need to test it :/ anyway im sure that this works

Code:
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 
plrent;
    
    
// find out whether the toucher or touched is the plr
    
if( toucher <= g_iMaxPlayers )
        
plr toucher;
    else if( 
touched <= g_iMaxPlayers )
        
plr touched;
    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;
        }
    }





Code:
ID   NAME                  SPEED   CLIP   AMMO   AID   ANAME             COST   ACOST   BUYNAME   BUYNAME2   
 1   weapon_p228             250     13     52     9   ammo_357sig        600      50   p228      228compact 
     weapon_shield             0      0      0     0                     2200       0   shield               
 3   weapon_scout            260     10     90     2   ammo_762nato      2750      80   scout                
 4   weapon_hegrenade        250             1    12                      300       0   hegren               
 5   weapon_xm1014           240      7     32     5   ammo_buckshot     3000      65   xm1014    autoshotgun
 6   weapon_c4               250      0      1    14                        0       0                        
 7   weapon_mac10            250     30    100     6   ammo_45acp        1400      25   mac10                
 8   weapon_aug              240     30     90     4   ammo_556nato      3500      60   aug       bullpup    
 9   weapon_smokegrenade     250             1    13                      300       0   sgren                
10   weapon_elite            250     30    120    10   ammo_9mm           800      20   elites               
11   weapon_fiveseven        250     20    100     7   ammo_57mm          750      50   fn57      fiveseven  
12   weapon_ump45            250     25    100     6   ammo_45acp        1700      25   ump45                
13   weapon_sg550            210     30     90     4   ammo_556nato      4200      60   sg550     krieg550   
14   weapon_galil            240     35     90     4   ammo_556nato      2000      60   galil     defender   
15   weapon_famas            240     25     90     4   ammo_556nato      2250      60   famas     clarion    
16   weapon_usp              250     12    100     6   ammo_45acp         500      25   usp       km45       
17   weapon_glock18          250     20    120    10   ammo_9mm           400      20   glock     9x19mm     
18   weapon_awp              210     10     30     1   ammo_338magnum    4750     125   awp       magnum     
19   weapon_mp5navy          250     30    120    10   ammo_9mm          1500      20   mp5       smg        
20   weapon_m249             220    100    200     3   ammo_556natobox   5750      60   m249                 
21   weapon_m3               230      8     32     5   ammo_buckshot     1700      65   m3        12gauge    
22   weapon_m4a1             230     30     90     4   ammo_556nato      3100      60   m4a1                 
23   weapon_tmp              250     30    120    10   ammo_9mm          1250      20   tmp       mp         
24   weapon_g3sg1            210     20     90     2   ammo_762nato      5000      80   g3sg1     d3au1      
25   weapon_flashbang        250             2    11                      200       0   flash                
26   weapon_deagle           250      7     35     8   ammo_50ae          650      40   deagle    nighthawk  
27   weapon_sg552            235     30     90     4   ammo_556nato      3500      60   sg552     krieg552   
28   weapon_ak47             221     30     90     2   ammo_762nato      2500      80   ak47      cv47       
29   weapon_knife            250      0      0     0                        0       0                        
30   weapon_p90              245     50    100     7   ammo_57mm         2350      50   p90       c90
__________________

Last edited by SchlumPF*; 12-21-2008 at 12:31.
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