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

[L4D2]Plugin edit / help requests


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Darkwob
BANNED
Join Date: Oct 2018
Old 08-28-2019 , 08:53   [L4D2]Plugin edit / help requests
Reply With Quote #1

Hi guys, I've been using this plugin for a while, but I've never seen it work. I edited the" cfg " file, but it still didn't work. "hunter,charger,jockey and smoker" doesn't leave survivor attacked. I press repeatedly on the right side of the mouse, but infected continues to attack survivor infected.

PHP Code:
/* Plugin Template generated by Pawn Studio */

#include <sourcemod>
#include <sdktools>

#define CVAR_FLAGS FCVAR_PLUGIN
#define PLUGIN_VERSION "1.3a"
#define INFECTEDTEAM 3
#define ZOMBIECLASS_SMOKER    1
#define ZOMBIECLASS_BOOMER    2
#define ZOMBIECLASS_HUNTER    3
#define ZOMBIECLASS_SPITTER    4
#define ZOMBIECLASS_JOCKEY    5
#define ZOMBIECLASS_CHARGER    6

new Handle:g_hConVar_JockeyReleaseOn;
new 
Handle:g_hConVar_HunterReleaseOn;
new 
Handle:g_hConVar_ChargerReleaseOn;
new 
Handle:g_hConVar_ChargerChargeInterval;
new 
Handle:g_hConVar_JockeyAttackDelay;
new 
Handle:g_hConVar_HunterAttackDelay;
new 
Handle:g_hConVar_ChargerAttackDelay;
new 
bool:g_isJockeyEnabled;
new 
bool:g_isHunterEnabled;
new 
bool:g_isChargerEnabled;

new 
bool:g_ButtonDelay[MAXPLAYERS+1];

public 
Plugin:myinfo 
{
    
name "[L4D2] Infected Release",
    
author "Thraka",
    
description "Allows infected players to release victims with the melee button.",
    
version PLUGIN_VERSION,
    
url "http://forums.alliedmods.net/showthread.php?t=109715"
}

public 
APLRes:AskPluginLoad2(Handle:hPluginbool:isAfterMapLoadedString:error[], err_max)
{
    
// Require Left 4 Dead 2
    
decl String:game_name[64];
    
GetGameFolderName(game_namesizeof(game_name));
    if (!
StrEqual(game_name"left4dead2"false))
    {
        
Format(errorerr_max"Plugin only supports Left4Dead 2.");
        return 
APLRes_Failure;
    }
    return 
APLRes_Success;
}

public 
OnPluginStart()
{
    
    
CreateConVar("l4d2_infected_release_ver"PLUGIN_VERSION"Version of the infected release plugin."FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_NOTIFY);

    
g_hConVar_JockeyReleaseOn CreateConVar("l4d2_jockey_dismount_on""1""Jockey dismount is on or off. 1 = on"FCVAR_PLUGIN|FCVAR_NOTIFY);
    
g_hConVar_HunterReleaseOn CreateConVar("l4d2_hunter_release_on""1""Hunter release is on or off. 1 = on"FCVAR_PLUGIN|FCVAR_NOTIFY);
    
g_hConVar_ChargerReleaseOn CreateConVar("l4d2_charger_release_on""1""Charger release is on or off. 1 = on"FCVAR_PLUGIN|FCVAR_NOTIFY);
    
g_hConVar_JockeyAttackDelay CreateConVar("l4d2_jockey_attackdelay""3.0""After dismounting with the jockey, how long can the player not use attack1 and attack2"FCVAR_PLUGIN|FCVAR_NOTIFYtrue);
    
g_hConVar_HunterAttackDelay CreateConVar("l4d2_hunter_attackdelay""3.0""After dismounting with the hunter, how long can the player not use attack1 and attack2"FCVAR_PLUGIN|FCVAR_NOTIFYtrue);
    
g_hConVar_ChargerAttackDelay CreateConVar("l4d2_charger_attackdelay""3.0""After dismounting with the charger, how long can the player not use attack1 and attack2"FCVAR_PLUGIN|FCVAR_NOTIFYtrue);
    
    
g_hConVar_ChargerChargeInterval FindConVar("z_charge_interval");
    
    
HookConVarChange(g_hConVar_JockeyReleaseOnCVarChange_JockeyRelease);
    
HookConVarChange(g_hConVar_HunterReleaseOnCVarChange_HunterRelease);
    
HookConVarChange(g_hConVar_ChargerReleaseOnCVarChange_ChargerRelease);
    
    
AutoExecConfig(true"l4d2_infected_release");
    
    
SetJockeyRelease();
    
SetHunterRelease();
    
SetChargerRelease();
}

/*
* ===========================================================================================================
* ===========================================================================================================

* CVAR Change events

* ===========================================================================================================
* ===========================================================================================================
*/

public CVarChange_JockeyRelease(Handle:convar, const String:oldValue[], const String:newValue[])
{
    
SetJockeyRelease();
}

public 
CVarChange_HunterRelease(Handle:convar, const String:oldValue[], const String:newValue[])
{
    
SetHunterRelease();
}

public 
CVarChange_ChargerRelease(Handle:convar, const String:oldValue[], const String:newValue[])
{
    
SetChargerRelease();
}

SetJockeyRelease()
{
    
g_isJockeyEnabled GetConVarInt(g_hConVar_JockeyReleaseOn) == 1;
}

SetHunterRelease()
{
    
g_isHunterEnabled GetConVarInt(g_hConVar_HunterReleaseOn) == 1;
}

SetChargerRelease()
{
    
g_isChargerEnabled GetConVarInt(g_hConVar_ChargerReleaseOn) == 1;
}

/*
* ===========================================================================================================
* ===========================================================================================================

* Normal Hooks\Events

* ===========================================================================================================
* ===========================================================================================================
*/

public Action:OnPlayerRunCmd(client, &buttons, &impulseFloat:vel[3], Float:angles[3], &weapon)
{
    if (
client == 0)
        return 
Plugin_Continue;
    
    if (
buttons IN_ATTACK2 && !g_ButtonDelay[client])
    {
        if (
GetClientTeam(client) == INFECTEDTEAM)
        {
            new 
zombieClass GetEntProp(clientProp_Send"m_zombieClass");
            
            if (
zombieClass == ZOMBIECLASS_JOCKEY && g_isJockeyEnabled)
            {
                new 
h_vic GetEntPropEnt(clientProp_Send"m_jockeyVictim");
                
                if (
IsValidEntity(h_vic) && h_vic != 0)
                {
                    
ExecuteCommand(client"dismount");
                    
                    
CreateTimer(GetConVarFloat(g_hConVar_JockeyAttackDelay), ResetDelayclient)
                    
g_ButtonDelay[client] = true;
                }
            }
            else if (
zombieClass == ZOMBIECLASS_HUNTER && g_isHunterEnabled)
            {
                new 
h_vic GetEntPropEnt(clientProp_Send"m_pounceVictim");
                
                if (
IsValidEntity(h_vic) && h_vic != 0)
                {
                    
CallOnPounceEnd(client);

                    
CreateTimer(GetConVarFloat(g_hConVar_HunterAttackDelay), ResetDelayclient)
                    
g_ButtonDelay[client] = true;
                }
            }
            else if (
zombieClass == ZOMBIECLASS_CHARGER && g_isChargerEnabled)
            {
                new 
h_vic GetEntPropEnt(clientProp_Send"m_pummelVictim");
                
                if (
IsValidEntity(h_vic) && h_vic != 0)
                {
                    
CallOnPummelEnded(client);
                    
                    if (
g_hConVar_ChargerChargeInterval != INVALID_HANDLE)
                        
CallResetAbility(clientGetConVarFloat(g_hConVar_ChargerChargeInterval));
                    
                    
CreateTimer(GetConVarFloat(g_hConVar_ChargerAttackDelay), ResetDelayclient)
                    
g_ButtonDelay[client] = true;
                }
            }
        }
    }
    
    
// If delayed, don't let them click
    
if (buttons IN_ATTACK && g_ButtonDelay[client])
    {
        
buttons &= ~IN_ATTACK;
    }
    
    
// If delayed, don't let them click
    
if (buttons IN_ATTACK2 && g_ButtonDelay[client])
    {
        
buttons &= ~IN_ATTACK2;
    }
    
    return 
Plugin_Continue;
}


public 
Action:ResetDelay(Handle:timerany:client)
{
    
g_ButtonDelay[client] = false;
}
/*
* ===========================================================================================================
* ===========================================================================================================

* Private Methods

* ===========================================================================================================
* ===========================================================================================================
*/

ExecuteCommand(ClientString:strCommand[])
{
    new 
flags GetCommandFlags(strCommand);
    
    
SetCommandFlags(strCommandflags & ~FCVAR_CHEAT);
    
FakeClientCommand(Client"%s"strCommand);
    
SetCommandFlags(strCommandflags);
}

CallOnPummelEnded(client)
{
    static 
Handle:hOnPummelEnded=INVALID_HANDLE;
    if (
hOnPummelEnded==INVALID_HANDLE){
        new 
Handle:hConf INVALID_HANDLE;
        
hConf LoadGameConfigFile("l4d2_infected_release");
        
StartPrepSDKCall(SDKCall_Player);
        
PrepSDKCall_SetFromConf(hConfSDKConf_Signature"CTerrorPlayer::OnPummelEnded");
        
PrepSDKCall_AddParameter(SDKType_Bool,SDKPass_Plain);
        
PrepSDKCall_AddParameter(SDKType_CBasePlayer,SDKPass_Pointer,VDECODE_FLAG_ALLOWNULL);
        
hOnPummelEnded EndPrepSDKCall();
        
CloseHandle(hConf);
        if (
hOnPummelEnded == INVALID_HANDLE){
            
SetFailState("Can't get CTerrorPlayer::OnPummelEnded SDKCall!");
            return;
        }            
    }
    
SDKCall(hOnPummelEnded,client,true,-1);
}

CallOnPounceEnd(client)
{
    static 
Handle:hOnPounceEnd=INVALID_HANDLE;
    if (
hOnPounceEnd==INVALID_HANDLE){
        new 
Handle:hConf INVALID_HANDLE;
        
hConf LoadGameConfigFile("l4d2_infected_release");
        
StartPrepSDKCall(SDKCall_Player);
        
PrepSDKCall_SetFromConf(hConfSDKConf_Signature"CTerrorPlayer::OnPounceEnd");
        
hOnPounceEnd EndPrepSDKCall();
        
CloseHandle(hConf);
        if (
hOnPounceEnd == INVALID_HANDLE){
            
SetFailState("Can't get CTerrorPlayer::OnPounceEnd SDKCall!");
            return;
        }            
    }
    
SDKCall(hOnPounceEnd,client);


CallResetAbility(client,Float:time)
{
    static 
Handle:hStartActivationTimer=INVALID_HANDLE;
    if (
hStartActivationTimer==INVALID_HANDLE)
    {
        new 
Handle:hConf INVALID_HANDLE;
        
hConf LoadGameConfigFile("l4d2_infected_release");

        
StartPrepSDKCall(SDKCall_Entity);

        
PrepSDKCall_SetFromConf(hConfSDKConf_Signature"CBaseAbility::StartActivationTimer");
        
PrepSDKCall_AddParameter(SDKType_Float,SDKPass_Plain);
        
PrepSDKCall_AddParameter(SDKType_Float,SDKPass_Plain);

        
hStartActivationTimer EndPrepSDKCall();
        
CloseHandle(hConf);
        
        if (
hStartActivationTimer == INVALID_HANDLE)
        {
            
SetFailState("Can't get CBaseAbility::StartActivationTimer SDKCall!");
            return;
        }            
    }
    new 
AbilityEnt=GetEntPropEnt(clientProp_Send"m_customAbility");
    
SDKCall(hStartActivationTimerAbilityEnttime0.0);

Attached Files
File Type: sp Get Plugin or Get Source (l4d2_infected_release.sp - 87 views - 9.5 KB)

Last edited by Darkwob; 08-28-2019 at 15:23.
Darkwob is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 08-28-2019 , 10:59   Re: [L4D2]Plugin edit / help requests
Reply With Quote #2

Again you're cross-posting.. stop. Post in the original plugin thread. Also use the PHP tags instead of CODE, and if you're attaching the same source then why post the source in the thread too.
__________________
Silvers is offline
Darkwob
BANNED
Join Date: Oct 2018
Old 08-28-2019 , 15:23   Re: [L4D2]Plugin edit / help requests
Reply With Quote #3

Quote:
Originally Posted by Silvers View Post
Again you're cross-posting.. stop. Post in the original plugin thread. Also use the PHP tags instead of CODE, and if you're attaching the same source then why post the source in the thread too.
bro, this isn't cross-posting. if you look at the context, you'll know.
Darkwob is offline
Darkwob
BANNED
Join Date: Oct 2018
Old 08-28-2019 , 15:27   Re: [L4D2]Plugin edit / help requests
Reply With Quote #4

Quote:
Originally Posted by Silvers View Post
Again you're cross-posting.. stop. Post in the original plugin thread. Also use the PHP tags instead of CODE, and if you're attaching the same source then why post the source in the thread too.
I think you're the software bro.Can you please rearrange this plugin? when I click on the right side of the mouse ,smoker, charger,jockey,hunter continues to attack and survivor dont release.
Darkwob is offline
cacaopea
Member
Join Date: May 2019
Location: Viet Nam
Old 08-29-2019 , 08:01   Re: [L4D2]Plugin edit / help requests
Reply With Quote #5

i think you shouldn't use this plugin
if you want you can use plugin: air ability
Some are good at plugins on the alliedmodder will never care to help or respond to anything, so bad
I recommend hiring someone to help you edit or create plugins

Last edited by cacaopea; 08-29-2019 at 08:10.
cacaopea 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 21:37.


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