Raised This Month: $51 Target: $400
 12% 

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 , 07:22   These plugins wont function in latest sm build
Reply With Quote #1

Hi. 2 of the plugins I am running on my server/s are being loaded but simply doesn't function. Can't find any output regarding this in the error logs. I thought maybe someone can see an immediate fix or maybe I have to wait until a new build? Im running linux btw

Here they are:


knife delay by Arkarr & thedudeguy1.
Source: https://forums.alliedmods.net/showpo...48&postcount=6

PHP Code:
#include <sourcemod>  
#include <sdktools>  
#include <sdkhooks>  

#define PLUGIN_AUTHOR     "Arkarr, thedudeguy1"  
#define PLUGIN_VERSION     "1.3"  

bool Marked[MAXPLAYERS 1];  

public 
Plugin myinfo =   
{  
    
name "[ANY] Knife Attack Delay",   
    
author PLUGIN_AUTHOR,   
    
description "Set a delay between each attack on the same player.",   
    
version PLUGIN_VERSION,   
    
url "https://forums.alliedmods.net/showpost.php?p=2499248&postcount=6"  
};  

public 
void OnPluginStart()  
{  
    for (new 
1<= MaxClientsi++)  
    {  
        if (
IsClientInGame(i))  
            
SDKHook(iSDKHook_OnTakeDamageOnTakeDamage);  
    }  
}  

public 
void OnClientPutInServer(int client)  
{  
    
SDKHook(clientSDKHook_OnTakeDamageOnTakeDamage);  
}  

public 
Action OnTakeDamage(int victimint &attackerint &inflictorfloat &damageint &damagetype)  
{  
    if (
victim || victim MaxClients || attacker || attacker MaxClients)  
        return 
Plugin_Continue;  
         
    
char weapon[64];  
    
GetClientWeapon(attackerweaponsizeof(weapon));  
      
    if (
StrEqual(weapon"weapon_knife"false))  
    {  
        if (!
Marked[victim])  
        {  
            
ImmunePlayer(victim);      
        }              
        else  
        {  
            return 
Plugin_Handled;  
        }  
    }  
      
    return 
Plugin_Continue;  
}  

public 
void ImmunePlayer(int client)  
{  
    
Marked[client] = true;  
    
SetEntityRenderMode(clientRENDER_TRANSCOLOR);  
    
SetEntityRenderColor(client100255100200);  
      
    
CreateTimer(3.0TMR_Unmarkclient);  
}  

public 
Action TMR_Unmark(Handle tmrany client)  
{  
    
Marked[client] = false;  
    
SetEntityRenderMode(clientRENDER_TRANSCOLOR);  
    
SetEntityRenderColor(client255255255255);  


Antibackstab by unknown:

PHP Code:
#include <sdkhooks> 

public void OnPluginStart() 

    for (new 
client 1client <= MaxClientsclient++) 
    { 
        if (!
IsClientInGame(client)) 
            continue; 
             
        
OnClientPutInServer(client); 
         
    }     

public 
void OnClientPutInServer(int client

    
SDKHook(clientSDKHook_OnTakeDamageOnTakeDamage); 


public 
Action OnTakeDamage(int victimint &attackerint &inflictorfloat &damageint &damagetype

    if (
victim || victim MaxClients || attacker || attacker MaxClients
        return 
Plugin_Continue

    if (
damage 55.0
    { 
        
char weapon[64]; 
        
GetClientWeapon(attackerweaponsizeof(weapon)); 
        if (
StrEqual(weapon"weapon_knife"false)) 
        { 
            
damage 55.0
            return 
Plugin_Changed
        } 
    } 
    return 
Plugin_Continue

I've tried look up in the discussion thread of what I may change in order to fix it but couldn't find out much about it. Appreciate any help
deville is offline
Totenfluch
AlliedModders Donor
Join Date: Jan 2012
Location: Germany
Old 08-20-2017 , 08:46   Re: These plugins wont function in latest sm build
Reply With Quote #2

I've noticed those kind of plugins only not working with bayonetts. Normal knifes work fine for me
__________________
Notable Projects:
Event Item Spawner | Scissors, Rock, Paper for ZephStore
tVip | Smart Link Remover
PLG & GGC - CS:GO Roleplay

and countless more...

I can make a helicopter shoot missles if you want me to...
Totenfluch is offline
deville
AlliedModders Donor
Join Date: Oct 2016
Old 08-20-2017 , 08:48   Re: These plugins wont function in latest sm build
Reply With Quote #3

Quote:
Originally Posted by Totenfluch View Post
I've noticed those kind of plugins only not working with bayonetts. Normal knifes work fine for me
I know there was something similar with prestrafing on kztimer. I'll check once i get back. Thank you!
deville is offline
OSWO
Senior Member
Join Date: Jul 2015
Location: United Kingdom, London
Old 08-20-2017 , 08:52   Re: These plugins wont function in latest sm build
Reply With Quote #4

Bayonets have had their name changed.
__________________
SourceTimer | WeaponSkins++ | BasePlugins++ https://github.com/OSCAR-WOS
OSWO is offline
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 #5

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 #6

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 #7

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



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 02:37.


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