Raised This Month: $ Target: $400
 0% 

Help me modify this plugin.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
igor.ol13
Junior Member
Join Date: Nov 2012
Old 01-14-2013 , 18:27   Re: Help me modify this plugin.
Reply With Quote #2

I think that get_user_weapon(attacker) isn't used in this way... So try something like this:


PHP Code:
in plugin_init
register_event
("CurWeapon""switchedWeapon""be"); // I don't know if is really "be" or "ae" :x

then create a global variable to store if player is using a SG550something like
bool
:g_usingSG550[33];

then implement switchedWeaponsomething like:
public 
switchedWeapon()
{
    static 
        
ent,
        
szClass[32];
    
ent read_data(2); // Get weapon ID
    
pev(entpev_classnameszClass31); // Get weapon class
    
if (equal(szClass"weapon_sg550"))
        
g_usingSG550[pev(entpev_owner)] = true;
    else
        
g_usingSG550[pev(entpev_owner)] = false;
}

in fw_TakeDamage
public fw_TakeDamage(victiminflictorattackerFloat:damage
{
    if (
victim != attacker && is_user_connected(attacker)) 
    { 
    if (
g_usingSG550[attacker]) 
        { 
            if(
g_has_as50[attacker]) 
                
SetHamParamFloat(4damage get_pcvar_float(cvar_dmg_as50)) 
        } 
    } 


ps: I never used this, so I'm sorry if doesn't work

Last edited by igor.ol13; 01-14-2013 at 18:46. Reason: forgot that isn't pev_class, it's pev_classname
igor.ol13 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 13:40.


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