Raised This Month: $ Target: $400
 0% 

These plugins wont function in latest sm build


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
deville
AlliedModders Donor
Join Date: Oct 2016
Old 08-20-2017 , 09:26   Re: These plugins wont function in latest sm build
Reply With Quote #1

Yup this seems to be the issue. How would I approach to resolving this issue in the code?

Last edited by deville; 08-20-2017 at 09:26.
deville is offline
OfficialSikari
Junior Member
Join Date: Aug 2017
Location: /dev/null
Old 08-20-2017 , 09:31   Re: These plugins wont function in latest sm build
Reply With Quote #2

Code:
public Action OnTakeDamage(int victim, int &attacker, int &inflictor, float &damage, int &damagetype)   
{   
    if (victim < 1 || victim > MaxClients || attacker < 1 || attacker > MaxClients)   
        return Plugin_Continue;   
          
    char weapon[64];   
    GetClientWeapon(attacker, weapon, sizeof(weapon));   
       
    if (StrEqual(weapon, "weapon_knife", false))   
    {   
        if (!Marked[victim])   
        {   
            ImmunePlayer(victim);       
        }               
        else   
        {   
            return Plugin_Handled;   
        }   
    }   
       
    return Plugin_Continue;   
}
Into

Code:
public Action OnTakeDamage(int victim, int &attacker, int &inflictor, float &damage, int &damagetype)   
{   
    if (victim < 1 || victim > MaxClients || attacker < 1 || attacker > MaxClients)   
        return Plugin_Continue;   
          
    char weapon[64];   
    GetClientWeapon(attacker, weapon, sizeof(weapon));   
       
    if (StrEqual(weapon, "weapon_knife", false) || 
       StrEqual(weapon, "weapon_bayonet", false) ||
       StrContains(weapon, "weapon_knife_", false) != -1)
    {   
        if (!Marked[victim])   
        {   
            ImmunePlayer(victim);       
        }               
        else   
        {   
            return Plugin_Handled;   
        }   
    }   
       
    return Plugin_Continue;   
}

Last edited by OfficialSikari; 08-20-2017 at 09:42.
OfficialSikari is offline
deville
AlliedModders Donor
Join Date: Oct 2016
Old 08-20-2017 , 10:56   Re: These plugins wont function in latest sm build
Reply With Quote #3

Quote:
Originally Posted by OfficialSikari View Post
Code:
public Action OnTakeDamage(int victim, int &attacker, int &inflictor, float &damage, int &damagetype)   
{   
    if (victim < 1 || victim > MaxClients || attacker < 1 || attacker > MaxClients)   
        return Plugin_Continue;   
          
    char weapon[64];   
    GetClientWeapon(attacker, weapon, sizeof(weapon));   
       
    if (StrEqual(weapon, "weapon_knife", false))   
    {   
        if (!Marked[victim])   
        {   
            ImmunePlayer(victim);       
        }               
        else   
        {   
            return Plugin_Handled;   
        }   
    }   
       
    return Plugin_Continue;   
}
Into

Code:
public Action OnTakeDamage(int victim, int &attacker, int &inflictor, float &damage, int &damagetype)   
{   
    if (victim < 1 || victim > MaxClients || attacker < 1 || attacker > MaxClients)   
        return Plugin_Continue;   
          
    char weapon[64];   
    GetClientWeapon(attacker, weapon, sizeof(weapon));   
       
    if (StrEqual(weapon, "weapon_knife", false) || 
       StrEqual(weapon, "weapon_bayonet", false) ||
       StrContains(weapon, "weapon_knife_", false) != -1)
    {   
        if (!Marked[victim])   
        {   
            ImmunePlayer(victim);       
        }               
        else   
        {   
            return Plugin_Handled;   
        }   
    }   
       
    return Plugin_Continue;   
}
Thanks a lot Sikari! This one fixed it for both plugins. I didn't really know what exactly got changed in the weapon index so I didn't know what to do. Now I understand.

A moderator can mark this as solved, or however things work in these forums :p
deville is offline
Reply


Thread Tools
Display Modes

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


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