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

L4D2 - The Last Stand Update - Issues and Bugs - Mega Thread


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Smoak
Junior Member
Join Date: Dec 2019
Location: Maine
Old 09-26-2020 , 20:28   Re: L4D2 - The Last Stand Update - Issues and Bugs - Mega Thread
#131

Someone able to help me make this mod work with the update? (https://forums.alliedmods.net/showth...73749?t=173749)
I'd ask the original creator but they haven't been online since 2015..
Smoak is offline
NiTro1
Member
Join Date: Sep 2015
Location: france
Old 09-26-2020 , 20:32   Re: L4D2 - The Last Stand Update - Issues and Bugs - Mega Thread
#132

Quote:
Originally Posted by Smoak View Post
Someone able to help me make this mod work with the update? (https://forums.alliedmods.net/showth...73749?t=173749)
I'd ask the original creator but they haven't been online since 2015..
im using this plugin and its working fine. they have the same function :

https://forums.alliedmods.net/showthread.php?p=1567919

Last edited by NiTro1; 09-26-2020 at 20:34.
NiTro1 is offline
Smoak
Junior Member
Join Date: Dec 2019
Location: Maine
Old 09-26-2020 , 21:43   Re: L4D2 - The Last Stand Update - Issues and Bugs - Mega Thread
#133

Quote:
Originally Posted by NiTro1 View Post
im using this plugin and its working fine. they have the same function :

https://forums.alliedmods.net/showthread.php?p=1567919
I tried the mod but it didn't work.
Smoak is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 09-26-2020 , 22:40   Re: L4D2 - The Last Stand Update - Issues and Bugs - Mega Thread
#134

I doubt the upgrade broke either plugin. They should still be working.
__________________
Silvers is offline
rtokuda
Senior Member
Join Date: Dec 2019
Old 09-27-2020 , 00:43   Re: L4D2 - The Last Stand Update - Issues and Bugs - Mega Thread
#135

Can anyone include the new melee weapons in the l4d2_ty_saveweapon_4.sp plugin ?

PHP Code:
L 09/27/2020 00:01:39SourceMod error session started
L 09
/27/2020 00:01:39Info (map "c1m3_mall") (file "E:\game\steam\steamapps\common\Left 4 Dead 2\left4dead2\addons\sourcemod\logs\errors_20200927.log")
L 09/27/2020 00:01:39: [l4d2_ty_saveweapon_4.smxm_ModelName(models/weapons/melee/v_pitchfork.mdlweapon_melee
L 09
/27/2020 00:01:50Error log file session closed.
L 09/27/2020 00:58:39SourceMod error session started
L 09
/27/2020 00:58:39Info (map "c11m1_greenhouse") (file "E:\game\steam\steamapps\common\Left 4 Dead 2\left4dead2\addons\sourcemod\logs\errors_20200927.log")
L 09/27/2020 00:58:39: [l4d2_ty_saveweapon_4.smxm_ModelName(models/weapons/melee/v_shovel.mdlweapon_melee
L 09
/27/2020 00:58:51Error log file session closed

PHP Code:
/**
 * =============================================================================
 * L4D2 coop save weapon
 * Copyright 2011 - 2019 steamcommunity.com/profiles/76561198025355822/
 * Fixed 2015 steamcommunity.com/id/Electr0n
 * Fixed 2016 steamcommunity.com/id/mixjayrus
 * Fixed 2016 user Merudo
 * =============================================================================
 *
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU General Public License, version 3.0, as published by the
 * Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program.  If not, see <www.gnu.org/licenses/>.
 *
 * As a special exception, AlliedModders LLC gives you permission to link the
 * code of this program (as well as its derivative works) to "Half-Life 2," the
 * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
 * by the Valve Corporation.  You must obey the GNU General Public License in
 * all respects for all other code used.  Additionally, AlliedModders LLC grants
 * this exception to all derivative works.  AlliedModders LLC defines further
 * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
 * or <www.sourcemod.net/license.php>.
 *
*/
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#pragma newdecls required

char sg_buffer0[64];
char sg_buffer1[40];
char sg_buffer2[32];
char sg_buffer3[24];

char sg_slot0[MAXPLAYERS+1][40];
int ig_prop0[MAXPLAYERS+1]; /* m_iClip1 */
int ig_prop1[MAXPLAYERS+1]; /* m_iClip1 saw */
int ig_prop2[MAXPLAYERS+1]; /* m_upgradeBitVec */
int ig_prop3[MAXPLAYERS+1]; /* m_nUpgradedPrimaryAmmoLoaded */

char sg_slot1[MAXPLAYERS+1][40];
char sg_slot2[MAXPLAYERS+1][40];
char sg_slot3[MAXPLAYERS+1][40];
char sg_slot4[MAXPLAYERS+1][40];

char sg_defib[MAXPLAYERS+1][40];

int ig_coop;
int ig_time;
int ig_protection;

public 
Plugin myinfo =
{
    
name "[L4D2] Save Weapon",
    
author "MAKS",
    
description "L4D2 coop save weapon",
    
version "4.6",
    
url "forums.alliedmods.net/showthread.php?p=2304407"
};

public 
void OnPluginStart()
{
    
HookEvent("round_start"Event_RoundStartEventHookMode_PostNoCopy);
    
HookEvent("item_pickup"Event_ItemPickup);
    
HookEvent("defibrillator_used"Event_DefibUsed);
    
HookEvent("map_transition"Event_MapTransitionEventHookMode_PostNoCopy);
}

void HxPrecache()
{
    if (!
IsModelPrecached("models/survivors/survivor_biker.mdl"))
    {
        
PrecacheModel("models/survivors/survivor_biker.mdl"false);
    }
    if (!
IsModelPrecached("models/survivors/survivor_manager.mdl"))
    {
        
PrecacheModel("models/survivors/survivor_manager.mdl"false);
    }
    if (!
IsModelPrecached("models/survivors/survivor_teenangst.mdl"))
    {
        
PrecacheModel("models/survivors/survivor_teenangst.mdl"false);
    }
    if (!
IsModelPrecached("models/survivors/survivor_coach.mdl"))
    {
        
PrecacheModel("models/survivors/survivor_coach.mdl"false);
    }
    if (!
IsModelPrecached("models/survivors/survivor_gambler.mdl"))
    {
        
PrecacheModel("models/survivors/survivor_gambler.mdl"false);
    }
    if (!
IsModelPrecached("models/survivors/survivor_namvet.mdl"))
    {
        
PrecacheModel("models/survivors/survivor_namvet.mdl"false);
    }
    if (!
IsModelPrecached("models/survivors/survivor_mechanic.mdl"))
    {
        
PrecacheModel("models/survivors/survivor_mechanic.mdl"false);
    }
    if (!
IsModelPrecached("models/survivors/survivor_producer.mdl"))
    {
        
PrecacheModel("models/survivors/survivor_producer.mdl"false);
    }
    if (!
IsModelPrecached("models/infected/witch.mdl"))
    {
        
PrecacheModel("models/infected/witch.mdl"false);
    }
    if (!
IsModelPrecached("models/infected/witch_bride.mdl"))
    {
        
PrecacheModel("models/infected/witch_bride.mdl"false);
    }
    if (!
IsModelPrecached("models/v_models/v_rif_sg552.mdl"))
    {
        
PrecacheModel("models/v_models/v_rif_sg552.mdl"false);
    }
    if (!
IsModelPrecached("models/v_models/v_smg_mp5.mdl"))
    {
        
PrecacheModel("models/v_models/v_smg_mp5.mdl"false);
    }
    if (!
IsModelPrecached("models/v_models/v_snip_awp.mdl"))
    {
        
PrecacheModel("models/v_models/v_snip_awp.mdl"false);
    }
    if (!
IsModelPrecached("models/v_models/v_snip_scout.mdl"))
    {
        
PrecacheModel("models/v_models/v_snip_scout.mdl"false);
    }
    if (!
IsModelPrecached("models/w_models/weapons/50cal.mdl"))
    {
        
PrecacheModel("models/w_models/weapons/50cal.mdl"false);
    }
    if (!
IsModelPrecached("models/w_models/weapons/w_knife_t.mdl"))
    {
        
PrecacheModel("models/w_models/weapons/w_knife_t.mdl"false);
    }
    if (!
IsModelPrecached("models/w_models/weapons/w_rifle_sg552.mdl"))
    {
        
PrecacheModel("models/w_models/weapons/w_rifle_sg552.mdl"false);
    }
    if (!
IsModelPrecached("models/w_models/weapons/w_smg_mp5.mdl"))
    {
        
PrecacheModel("models/w_models/weapons/w_smg_mp5.mdl"false);
    }
    if (!
IsModelPrecached("models/w_models/weapons/w_sniper_awp.mdl"))
    {
        
PrecacheModel("models/w_models/weapons/w_sniper_awp.mdl"false);
    }
    if (!
IsModelPrecached("models/w_models/weapons/w_sniper_scout.mdl"))
    {
        
PrecacheModel("models/w_models/weapons/w_sniper_scout.mdl"false);
    }
    if (!
IsModelPrecached("models/weapons/melee/v_fireaxe.mdl"))
    {
        
PrecacheModel("models/weapons/melee/v_fireaxe.mdl"false);
    }
    if (!
IsModelPrecached("models/weapons/melee/v_frying_pan.mdl"))
    {
        
PrecacheModel("models/weapons/melee/v_frying_pan.mdl"false);
    }
    if (!
IsModelPrecached("models/weapons/melee/v_golfclub.mdl"))
    {
        
PrecacheModel("models/weapons/melee/v_golfclub.mdl"false);
    }    if (!
IsModelPrecached("models/weapons/melee/v_machete.mdl"))
    {
        
PrecacheModel("models/weapons/melee/v_machete.mdl"false);
    }
    if (!
IsModelPrecached("models/weapons/melee/w_cricket_bat.mdl"))
    {
        
PrecacheModel("models/weapons/melee/w_cricket_bat.mdl"false);
    }
    if (!
IsModelPrecached("models/weapons/melee/w_crowbar.mdl"))
    {
        
PrecacheModel("models/weapons/melee/w_crowbar.mdl"false);
    }
    if (!
IsModelPrecached("models/weapons/melee/w_electric_guitar.mdl"))
    {
        
PrecacheModel("models/weapons/melee/w_electric_guitar.mdl"false);
    }
    if (!
IsModelPrecached("models/weapons/melee/w_frying_pan.mdl"))
    {
        
PrecacheModel("models/weapons/melee/w_frying_pan.mdl"false);
    }
    if (!
IsModelPrecached("models/weapons/melee/w_golfclub.mdl"))
    {
        
PrecacheModel("models/weapons/melee/w_golfclub.mdl"false);
    }
    if (!
IsModelPrecached("models/weapons/melee/w_katana.mdl"))
    {
        
PrecacheModel("models/weapons/melee/w_katana.mdl"false);
    }
    if (!
IsModelPrecached("models/weapons/melee/w_machete.mdl"))
    {
        
PrecacheModel("models/weapons/melee/w_machete.mdl"false);
    }
    if (!
IsModelPrecached("models/weapons/melee/w_tonfa.mdl"))
    {
        
PrecacheModel("models/weapons/melee/w_tonfa.mdl"false);
    }
}

int HxGameMode()
{
    
GetConVarString(FindConVar("mp_gamemode"), sg_buffer3sizeof(sg_buffer3)-1);
    if (!
strcmp(sg_buffer3"coop"true))
    {
        return 
1;
    }
    if (!
strcmp(sg_buffer3"realism"true))
    {
        return 
2;
    }

    return 
0;
}

void HxCleaning(int &client)
{
    
ig_prop0[client] = 50;
    
ig_prop1[client] = 30;
    
ig_prop2[client] = 0;
    
ig_prop3[client] = 0;

    
sg_slot0[client][0] = '\0';
    
sg_slot1[client][0] = '\0';
    
sg_slot2[client][0] = '\0';
    
sg_slot3[client][0] = '\0';
    
sg_slot4[client][0] = '\0';
    
sg_defib[client][0] = '\0';
}

void HxKickC(int &client)
{
    
int iSlot0;
    
int iSlot2;
    
int iSlot3;
    
int iSlot4;

    if (
GetClientTeam(client) == 2)
    {
        if (
IsPlayerAlive(client))
        {
            
iSlot0 GetPlayerWeaponSlot(client0);
            
iSlot2 GetPlayerWeaponSlot(client2);
            
iSlot3 GetPlayerWeaponSlot(client3);
            
iSlot4 GetPlayerWeaponSlot(client4);

            if (
iSlot0 0)
            {
                
RemovePlayerItem(clientiSlot0);
                
AcceptEntityInput(iSlot0"Kill");
            }
            if (
iSlot2 0)
            {
                
RemovePlayerItem(clientiSlot2);
                
AcceptEntityInput(iSlot2"Kill");
            }
            if (
iSlot3 0)
            {
                
RemovePlayerItem(clientiSlot3);
                
AcceptEntityInput(iSlot3"Kill");
            }
            if (
iSlot4 0)
            {
                
RemovePlayerItem(clientiSlot4);
                
AcceptEntityInput(iSlot4"Kill");
            }
        }
    }

    
KickClient(client"Mt");
}

int HxGetSlot1(int &clientint iSlot1)
{
    
sg_buffer0[0] = '\0';
    
GetEntPropString(iSlot1Prop_Data"m_ModelName"sg_buffer0sizeof(sg_buffer0)-1);

    if (
StrContains(sg_buffer0"v_pistolA.mdl"true) != -1)
    {
        
sg_slot1[client] = "pistol";
        return 
1;
    }
    if (
StrContains(sg_buffer0"v_dual_pistolA.mdl"true) != -1)
    {
        
sg_slot1[client] = "dual_pistol";
        return 
1;
    }
    if (
StrContains(sg_buffer0"v_desert_eagle.mdl"true) != -1)
    {
        
sg_slot1[client] = "pistol_magnum";
        return 
1;
    }
    if (
StrContains(sg_buffer0"v_bat.mdl"true) != -1)
    {
        
sg_slot1[client] = "baseball_bat";
        return 
1;
    }
    if (
StrContains(sg_buffer0"v_cricket_bat.mdl"true) != -1)
    {
        
sg_slot1[client] = "cricket_bat";
        return 
1;
    }
    if (
StrContains(sg_buffer0"v_crowbar.mdl"true) != -1)
    {
        
sg_slot1[client] = "crowbar";
        return 
1;
    }
    if (
StrContains(sg_buffer0"v_fireaxe.mdl"true) != -1)
    {
        
sg_slot1[client] = "fireaxe";
        return 
1;
    }
    if (
StrContains(sg_buffer0"v_katana.mdl"true) != -1)
    {
        
sg_slot1[client] = "katana";
        return 
1;
    }
    if (
StrContains(sg_buffer0"v_golfclub.mdl"true) != -1)
    {
        
sg_slot1[client] = "golfclub";
        return 
1;
    }
    if (
StrContains(sg_buffer0"v_machete.mdl"true) != -1)
    {
        
sg_slot1[client] = "machete";
        return 
1;
    }
    if (
StrContains(sg_buffer0"v_tonfa.mdl"true) != -1)
    {
        
sg_slot1[client] = "tonfa";
        return 
1;
    }
    if (
StrContains(sg_buffer0"v_electric_guitar.mdl"true) != -1)
    {
        
sg_slot1[client] = "electric_guitar";
        return 
1;
    }
    if (
StrContains(sg_buffer0"v_frying_pan.mdl"true) != -1)
    {
        
sg_slot1[client] = "frying_pan";
        return 
1;
    }
    if (
StrContains(sg_buffer0"v_chainsaw.mdl"true) != -1)
    {
        
ig_prop1[client] = GetEntProp(iSlot1Prop_Send"m_iClip1"4);
        
sg_slot1[client] = "chainsaw";
        return 
1;
    }
    if (
StrContains(sg_buffer0"v_knife_t.mdl"true) != -1)
    {
        
sg_slot1[client] = "knife";
        return 
1;
    }

    
GetEdictClassname(iSlot1sg_slot1[client], 39);
    
LogError("m_ModelName(%s) %s"sg_buffer0sg_slot1[client]);
    return 
0;
}

void HxSaveC(int &client)
{
    
int iSlot0;
    
int iSlot1;
    
int iSlot2;
    
int iSlot3;
    
int iSlot4;

    if (
GetClientTeam(client) == 2)
    {
        if (
IsPlayerAlive(client))
        {
            

            
iSlot0 GetPlayerWeaponSlot(client0);
            
iSlot1 GetPlayerWeaponSlot(client1);
            
iSlot2 GetPlayerWeaponSlot(client2);
            
iSlot3 GetPlayerWeaponSlot(client3);
            
iSlot4 GetPlayerWeaponSlot(client4);

            if (
iSlot0 0)
            {
                
GetEdictClassname(iSlot0sg_slot0[client], 39);
                
ig_prop0[client] = GetEntProp(iSlot0Prop_Send"m_iClip1"4);
                
ig_prop2[client] = GetEntProp(iSlot0Prop_Send"m_upgradeBitVec"4);
                
ig_prop3[client] = GetEntProp(iSlot0Prop_Send"m_nUpgradedPrimaryAmmoLoaded"4);
                
RemovePlayerItem(clientiSlot0);
                
AcceptEntityInput(iSlot0"Kill");
            }
            if (
iSlot1 0)
            {
                
HxGetSlot1(clientiSlot1);
            }
            if (
iSlot2 0)
            {
                
GetEdictClassname(iSlot2sg_slot2[client], 39);
                
RemovePlayerItem(clientiSlot2);
                
AcceptEntityInput(iSlot2"Kill");
            }
            if (
iSlot3 0)
            {
                
GetEdictClassname(iSlot3sg_slot3[client], 39);
                
RemovePlayerItem(clientiSlot3);
                
AcceptEntityInput(iSlot3"Kill");
            }
            if (
iSlot4 0)
            {
                
GetEdictClassname(iSlot4sg_slot4[client], 39);
                
RemovePlayerItem(clientiSlot4);
                
AcceptEntityInput(iSlot4"Kill");
            }
        }
    }
}

void HxFakeCHEAT(int &client, const char[] sCmd, const char[] sArg)
{
    
int iFlags GetCommandFlags(sCmd);
    
SetCommandFlags(sCmdiFlags & ~FCVAR_CHEAT);
    
FakeClientCommand(client"%s %s"sCmdsArg);
    
SetCommandFlags(sCmdiFlags);
}

void HxGiveC(int &client)
{
    
int iSlot0;
    
int iSlot1;
    
int iSlot2;
    
int iSlot3;
    
int iSlot4;

    if (
IsPlayerAlive(client))
    {
        
iSlot0 GetPlayerWeaponSlot(client0);
        
iSlot1 GetPlayerWeaponSlot(client1);
        
iSlot2 GetPlayerWeaponSlot(client2);
        
iSlot3 GetPlayerWeaponSlot(client3);
        
iSlot4 GetPlayerWeaponSlot(client4);

        if (
iSlot0 0)
        {
            
RemovePlayerItem(clientiSlot0);
            
AcceptEntityInput(iSlot0"Kill");
        }
        if (
iSlot1 0)
        {
            
RemovePlayerItem(clientiSlot1);
            
AcceptEntityInput(iSlot1"Kill");
        }
        if (
iSlot2 0)
        {
            
RemovePlayerItem(clientiSlot2);
            
AcceptEntityInput(iSlot2"Kill");
        }
        if (
iSlot3 0)
        {
            
RemovePlayerItem(clientiSlot3);
            
AcceptEntityInput(iSlot3"Kill");
        }
        if (
iSlot4 0)
        {
            
RemovePlayerItem(clientiSlot4);
            
AcceptEntityInput(iSlot4"Kill");
        }

        if (
sg_slot0[client][0] != '\0')
        {
            
HxFakeCHEAT(client"give"sg_slot0[client]);
            
iSlot0 GetPlayerWeaponSlot(client0);
            
SetEntProp(iSlot0Prop_Send"m_iClip1"ig_prop0[client], 4);
            
SetEntProp(iSlot0Prop_Send"m_upgradeBitVec"ig_prop2[client], 4);
            
SetEntProp(iSlot0Prop_Send"m_nUpgradedPrimaryAmmoLoaded"ig_prop3[client], 4);
        }
        else
        {
            if (
ig_time GetTime())
            {
                
HxFakeCHEAT(client"give""smg_silenced");
                
SetEntProp(GetPlayerWeaponSlot(client0), Prop_Send"m_iClip1"504);
            }
        }

        if (
sg_slot1[client][0] != '\0')
        {
            if (!
strcmp(sg_slot1[client], "dual_pistol"true))
            {
                
HxFakeCHEAT(client"give""pistol");
                
HxFakeCHEAT(client"give""pistol");
            }
            else
            {
                
HxFakeCHEAT(client"give"sg_slot1[client]);
                if (!
strcmp(sg_slot1[client], "chainsaw"true))
                {
                    
iSlot1 GetPlayerWeaponSlot(client1);
                    
SetEntProp(iSlot1Prop_Send"m_iClip1"ig_prop1[client], 4);
                }
            }
        }
        else
        {
            
HxFakeCHEAT(client"give""pistol");
        }

        if (
sg_slot2[client][0] != '\0')
        {
            
HxFakeCHEAT(client"give"sg_slot2[client]);
        }
        if (
sg_slot3[client][0] != '\0')
        {
            
HxFakeCHEAT(client"give"sg_slot3[client]);
        }
        if (
sg_slot4[client][0] != '\0')
        {
            
HxFakeCHEAT(client"give"sg_slot4[client]);
        }
    }
}

public 
Action HxTimerConnected(Handle timerany client)
{
    if (
IsClientInGame(client))
    {
        if (
GetClientTeam(client) == 2)
        {
            if (
IsPlayerAlive(client))
            {
                
HxGiveC(client);
                return 
Plugin_Stop;
            }
        }
        
CreateTimer(2.0HxTimerConnectedclientTIMER_FLAG_NO_MAPCHANGE);
    }

    return 
Plugin_Stop;
}

public 
void OnMapStart()
{
    
HxPrecache();
    
ig_coop HxGameMode();
    if (
ig_coop)
    {
        
SetConVarInt(FindConVar("survivor_respawn_with_guns"), 0falsefalse);
    }

    
ig_protection 0;
    
GetCurrentMap(sg_buffer2sizeof(sg_buffer2)-1);
    if (
StrContains(sg_buffer2"m1_"true) > 1)
    {
        
int i 1;
        while (
<= MaxClients)
        {
            
HxCleaning(i);
            
+= 1;
        }
    }
}

public 
void OnClientPostAdminCheck(int client)
{
    if (!
IsFakeClient(client))
    {
        if (
ig_coop)
        {
            
CreateTimer(5.5HxTimerConnectedclientTIMER_FLAG_NO_MAPCHANGE);
        }
    }
}

public 
void OnClientDisconnect(int client)
{
    if (!
IsFakeClient(client))
    {
        if (!
ig_protection)
        {
            
HxCleaning(client);
        }
    }
}

public 
Action HxTimerRS(Handle timer)
{
    
int i 1;
    while (
<= MaxClients)
    {
        if (
IsClientInGame(i))
        {
            if (
GetClientTeam(i) == 2)
            {
                
HxGiveC(i);
            }
        }
        
+= 1;
    }

    return 
Plugin_Stop;
}

public 
void Event_RoundStart(Event event, const char[] namebool dontBroadcast)
{
    if (
ig_coop)
    {
        
ig_time GetTime() + 45;
        
CreateTimer(1.2HxTimerRS_TIMER_FLAG_NO_MAPCHANGE);
    }
}

public 
void Event_ItemPickup(Event event, const char[] namebool dontBroadcast)
{
    
int iUserid GetClientOfUserId(GetEventInt(event"userid"));
    if (
iUserid 0)
    {
        if (!
IsFakeClient(iUserid))
        {
            
GetEventString(event"item"sg_buffer1sizeof(sg_buffer1)-1);
            if (!
strcmp(sg_buffer1"pistol_magnum"true))
            {
                
sg_defib[iUserid] = "pistol_magnum";
            }
            if (!
strcmp(sg_buffer1"chainsaw"true))
            {
                
sg_defib[iUserid] = "chainsaw";
            }
            if (!
strcmp(sg_buffer1"melee"true))
            {
                
int iSlot1 GetPlayerWeaponSlot(iUserid1);
                if (
iSlot1 0)
                {
                    
GetEntPropString(iSlot1Prop_Data"m_strMapSetScriptName"sg_defib[iUserid], 39);
                }
            }
        }
    }
}

public 
Action HxTimerDefib(Handle timerany client)
{
    if (
IsClientInGame(client))
    {
        if (
GetClientTeam(client) == 2)
        {
            if (
IsPlayerAlive(client))
            {
                if (
sg_defib[client][0] != '\0')
                {
                    
int iSlot1 GetPlayerWeaponSlot(client1);
                    if (
iSlot1 0)
                    {
                        
RemovePlayerItem(clientiSlot1);
                        
AcceptEntityInput(iSlot1"Kill");
                    }
                    
HxFakeCHEAT(client"give"sg_defib[client]);
                }
            }
        }
    }

    return 
Plugin_Stop;
}

public 
void Event_DefibUsed(Event event, const char[] namebool dontBroadcast)
{
    
int iSubject GetClientOfUserId(GetEventInt(event"subject"));
    if (
iSubject 0)
    {
        if (
ig_coop)
        {
            
CreateTimer(1.0HxTimerDefibiSubjectTIMER_FLAG_NO_MAPCHANGE);
        }
    }
}

public 
void Event_MapTransition(Event event, const char[] namebool dontBroadcast)
{
    
int i 1;
    
ig_protection 1;

    if (
ig_coop)
    {
        while (
<= MaxClients)
        {
            if (
IsClientInGame(i))
            {
                
HxCleaning(i);
                if (
IsFakeClient(i))
                {
                    
HxKickC(i);
                }
                else
                {
                    
HxSaveC(i);
                }
            }
            
+= 1;
        }
    }

rtokuda is offline
rtokuda
Senior Member
Join Date: Dec 2019
Old 09-27-2020 , 01:11   Re: L4D2 - The Last Stand Update - Issues and Bugs - Mega Thread
#136

This strange model bug happens when I join L4D1 campaigns, this started to happen after the update.
Attached Images
File Type: jpg 1.jpg (96.8 KB, 184 views)
rtokuda is offline
Smoak
Junior Member
Join Date: Dec 2019
Location: Maine
Old 09-27-2020 , 01:23   Re: L4D2 - The Last Stand Update - Issues and Bugs - Mega Thread
#137

Quote:
Originally Posted by Silvers View Post
I doubt the upgrade broke either plugin. They should still be working.
Neither of those plugins work, someone on the development team said some changes were made to the lasersights and that might be why, so we need to figure out how to make either of those two mods work.
Smoak is offline
tRololo312312
Senior Member
Join Date: Apr 2015
Old 09-27-2020 , 05:32   Re: L4D2 - The Last Stand Update - Issues and Bugs - Mega Thread
#138

Could someone make this Gamedata work again?

Code:
"Games"
{
	"left4dead2"
	{
		"Signatures"
		{
			"CTerrorPlayer::SelectWeightedSequence"
			{
				"library"	"server"
				"linux"		"@_ZN13CTerrorPlayer22SelectWeightedSequenceE8Activity"
				"windows"	"\x55\x8B\x2A\x56\x57\x8B\x2A\x2A\x8B\x2A\x81\x2A\x2A\x2A\x2A\x2A\x75\x2A"
				"mac"		"@_ZN13CTerrorPlayer22SelectWeightedSequenceE8Activity"
			}
			"CTerrorPlayer::DoAnimationEvent"
			{
				"library"	"server"
				"linux"		"@_ZN13CTerrorPlayer16DoAnimationEventE17PlayerAnimEvent_ti"
				"windows"	"\x55\x8B\x2A\x56\x8B\x2A\x2A\x57\x8B\x2A\x83\x2A\x2A\x74\x2A\x8B\x2A\x2A\x2A\x2A\x2A\x8B\x2A"
				"mac"		"@_ZN13CTerrorPlayer16DoAnimationEventE17PlayerAnimEvent_ti"
			}
			"CBaseAnimating::LookupSequence"
			{
				"library"	"server"
				"linux"		"@_ZN14CBaseAnimating14LookupSequenceEPKc"
				"windows"	"\x55\x8B\x2A\x56\x8B\x2A\x83\x2A\x2A\x2A\x2A\x2A\x2A\x75\x2A\xE8\x7C\xE0"
				"mac"		"@_ZN14CBaseAnimating14LookupSequenceEPKc"
			}
		}
	}
}
tRololo312312 is offline
dr_lex
Member
Join Date: Dec 2014
Old 09-27-2020 , 05:37   Re: L4D2 - The Last Stand Update - Issues and Bugs - Mega Thread
#139

Quote:
Originally Posted by rtokuda View Post
Can anyone include the new melee weapons in the l4d2_ty_saveweapon_4.sp plugin ?

PHP Code:
L 09/27/2020 00:01:39SourceMod error session started
L 09
/27/2020 00:01:39Info (map "c1m3_mall") (file "E:\game\steam\steamapps\common\Left 4 Dead 2\left4dead2\addons\sourcemod\logs\errors_20200927.log")
L 09/27/2020 00:01:39: [l4d2_ty_saveweapon_4.smxm_ModelName(models/weapons/melee/v_pitchfork.mdlweapon_melee
L 09
/27/2020 00:01:50Error log file session closed.
L 09/27/2020 00:58:39SourceMod error session started
L 09
/27/2020 00:58:39Info (map "c11m1_greenhouse") (file "E:\game\steam\steamapps\common\Left 4 Dead 2\left4dead2\addons\sourcemod\logs\errors_20200927.log")
L 09/27/2020 00:58:39: [l4d2_ty_saveweapon_4.smxm_ModelName(models/weapons/melee/v_shovel.mdlweapon_melee
L 09
/27/2020 00:58:51Error log file session closed

PHP Code:
/**
 * =============================================================================
 * L4D2 coop save weapon
 * Copyright 2011 - 2019 steamcommunity.com/profiles/76561198025355822/
 * Fixed 2015 steamcommunity.com/id/Electr0n
 * Fixed 2016 steamcommunity.com/id/mixjayrus
 * Fixed 2016 user Merudo
 * =============================================================================
 *
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU General Public License, version 3.0, as published by the
 * Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program.  If not, see <www.gnu.org/licenses/>.
 *
 * As a special exception, AlliedModders LLC gives you permission to link the
 * code of this program (as well as its derivative works) to "Half-Life 2," the
 * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
 * by the Valve Corporation.  You must obey the GNU General Public License in
 * all respects for all other code used.  Additionally, AlliedModders LLC grants
 * this exception to all derivative works.  AlliedModders LLC defines further
 * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
 * or <www.sourcemod.net/license.php>.
 *
*/
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#pragma newdecls required

char sg_buffer0[64];
char sg_buffer1[40];
char sg_buffer2[32];
char sg_buffer3[24];

char sg_slot0[MAXPLAYERS+1][40];
int ig_prop0[MAXPLAYERS+1]; /* m_iClip1 */
int ig_prop1[MAXPLAYERS+1]; /* m_iClip1 saw */
int ig_prop2[MAXPLAYERS+1]; /* m_upgradeBitVec */
int ig_prop3[MAXPLAYERS+1]; /* m_nUpgradedPrimaryAmmoLoaded */

char sg_slot1[MAXPLAYERS+1][40];
char sg_slot2[MAXPLAYERS+1][40];
char sg_slot3[MAXPLAYERS+1][40];
char sg_slot4[MAXPLAYERS+1][40];

char sg_defib[MAXPLAYERS+1][40];

int ig_coop;
int ig_time;
int ig_protection;

public 
Plugin myinfo =
{
    
name "[L4D2] Save Weapon",
    
author "MAKS",
    
description "L4D2 coop save weapon",
    
version "4.6",
    
url "forums.alliedmods.net/showthread.php?p=2304407"
};

public 
void OnPluginStart()
{
    
HookEvent("round_start"Event_RoundStartEventHookMode_PostNoCopy);
    
HookEvent("item_pickup"Event_ItemPickup);
    
HookEvent("defibrillator_used"Event_DefibUsed);
    
HookEvent("map_transition"Event_MapTransitionEventHookMode_PostNoCopy);
}

void HxPrecache()
{
    if (!
IsModelPrecached("models/survivors/survivor_biker.mdl"))
    {
        
PrecacheModel("models/survivors/survivor_biker.mdl"false);
    }
    if (!
IsModelPrecached("models/survivors/survivor_manager.mdl"))
    {
        
PrecacheModel("models/survivors/survivor_manager.mdl"false);
    }
    if (!
IsModelPrecached("models/survivors/survivor_teenangst.mdl"))
    {
        
PrecacheModel("models/survivors/survivor_teenangst.mdl"false);
    }
    if (!
IsModelPrecached("models/survivors/survivor_coach.mdl"))
    {
        
PrecacheModel("models/survivors/survivor_coach.mdl"false);
    }
    if (!
IsModelPrecached("models/survivors/survivor_gambler.mdl"))
    {
        
PrecacheModel("models/survivors/survivor_gambler.mdl"false);
    }
    if (!
IsModelPrecached("models/survivors/survivor_namvet.mdl"))
    {
        
PrecacheModel("models/survivors/survivor_namvet.mdl"false);
    }
    if (!
IsModelPrecached("models/survivors/survivor_mechanic.mdl"))
    {
        
PrecacheModel("models/survivors/survivor_mechanic.mdl"false);
    }
    if (!
IsModelPrecached("models/survivors/survivor_producer.mdl"))
    {
        
PrecacheModel("models/survivors/survivor_producer.mdl"false);
    }
    if (!
IsModelPrecached("models/infected/witch.mdl"))
    {
        
PrecacheModel("models/infected/witch.mdl"false);
    }
    if (!
IsModelPrecached("models/infected/witch_bride.mdl"))
    {
        
PrecacheModel("models/infected/witch_bride.mdl"false);
    }
    if (!
IsModelPrecached("models/v_models/v_rif_sg552.mdl"))
    {
        
PrecacheModel("models/v_models/v_rif_sg552.mdl"false);
    }
    if (!
IsModelPrecached("models/v_models/v_smg_mp5.mdl"))
    {
        
PrecacheModel("models/v_models/v_smg_mp5.mdl"false);
    }
    if (!
IsModelPrecached("models/v_models/v_snip_awp.mdl"))
    {
        
PrecacheModel("models/v_models/v_snip_awp.mdl"false);
    }
    if (!
IsModelPrecached("models/v_models/v_snip_scout.mdl"))
    {
        
PrecacheModel("models/v_models/v_snip_scout.mdl"false);
    }
    if (!
IsModelPrecached("models/w_models/weapons/50cal.mdl"))
    {
        
PrecacheModel("models/w_models/weapons/50cal.mdl"false);
    }
    if (!
IsModelPrecached("models/w_models/weapons/w_knife_t.mdl"))
    {
        
PrecacheModel("models/w_models/weapons/w_knife_t.mdl"false);
    }
    if (!
IsModelPrecached("models/w_models/weapons/w_rifle_sg552.mdl"))
    {
        
PrecacheModel("models/w_models/weapons/w_rifle_sg552.mdl"false);
    }
    if (!
IsModelPrecached("models/w_models/weapons/w_smg_mp5.mdl"))
    {
        
PrecacheModel("models/w_models/weapons/w_smg_mp5.mdl"false);
    }
    if (!
IsModelPrecached("models/w_models/weapons/w_sniper_awp.mdl"))
    {
        
PrecacheModel("models/w_models/weapons/w_sniper_awp.mdl"false);
    }
    if (!
IsModelPrecached("models/w_models/weapons/w_sniper_scout.mdl"))
    {
        
PrecacheModel("models/w_models/weapons/w_sniper_scout.mdl"false);
    }
    if (!
IsModelPrecached("models/weapons/melee/v_fireaxe.mdl"))
    {
        
PrecacheModel("models/weapons/melee/v_fireaxe.mdl"false);
    }
    if (!
IsModelPrecached("models/weapons/melee/v_frying_pan.mdl"))
    {
        
PrecacheModel("models/weapons/melee/v_frying_pan.mdl"false);
    }
    if (!
IsModelPrecached("models/weapons/melee/v_golfclub.mdl"))
    {
        
PrecacheModel("models/weapons/melee/v_golfclub.mdl"false);
    }    if (!
IsModelPrecached("models/weapons/melee/v_machete.mdl"))
    {
        
PrecacheModel("models/weapons/melee/v_machete.mdl"false);
    }
    if (!
IsModelPrecached("models/weapons/melee/w_cricket_bat.mdl"))
    {
        
PrecacheModel("models/weapons/melee/w_cricket_bat.mdl"false);
    }
    if (!
IsModelPrecached("models/weapons/melee/w_crowbar.mdl"))
    {
        
PrecacheModel("models/weapons/melee/w_crowbar.mdl"false);
    }
    if (!
IsModelPrecached("models/weapons/melee/w_electric_guitar.mdl"))
    {
        
PrecacheModel("models/weapons/melee/w_electric_guitar.mdl"false);
    }
    if (!
IsModelPrecached("models/weapons/melee/w_frying_pan.mdl"))
    {
        
PrecacheModel("models/weapons/melee/w_frying_pan.mdl"false);
    }
    if (!
IsModelPrecached("models/weapons/melee/w_golfclub.mdl"))
    {
        
PrecacheModel("models/weapons/melee/w_golfclub.mdl"false);
    }
    if (!
IsModelPrecached("models/weapons/melee/w_katana.mdl"))
    {
        
PrecacheModel("models/weapons/melee/w_katana.mdl"false);
    }
    if (!
IsModelPrecached("models/weapons/melee/w_machete.mdl"))
    {
        
PrecacheModel("models/weapons/melee/w_machete.mdl"false);
    }
    if (!
IsModelPrecached("models/weapons/melee/w_tonfa.mdl"))
    {
        
PrecacheModel("models/weapons/melee/w_tonfa.mdl"false);
    }
}

int HxGameMode()
{
    
GetConVarString(FindConVar("mp_gamemode"), sg_buffer3sizeof(sg_buffer3)-1);
    if (!
strcmp(sg_buffer3"coop"true))
    {
        return 
1;
    }
    if (!
strcmp(sg_buffer3"realism"true))
    {
        return 
2;
    }

    return 
0;
}

void HxCleaning(int &client)
{
    
ig_prop0[client] = 50;
    
ig_prop1[client] = 30;
    
ig_prop2[client] = 0;
    
ig_prop3[client] = 0;

    
sg_slot0[client][0] = '\0';
    
sg_slot1[client][0] = '\0';
    
sg_slot2[client][0] = '\0';
    
sg_slot3[client][0] = '\0';
    
sg_slot4[client][0] = '\0';
    
sg_defib[client][0] = '\0';
}

void HxKickC(int &client)
{
    
int iSlot0;
    
int iSlot2;
    
int iSlot3;
    
int iSlot4;

    if (
GetClientTeam(client) == 2)
    {
        if (
IsPlayerAlive(client))
        {
            
iSlot0 GetPlayerWeaponSlot(client0);
            
iSlot2 GetPlayerWeaponSlot(client2);
            
iSlot3 GetPlayerWeaponSlot(client3);
            
iSlot4 GetPlayerWeaponSlot(client4);

            if (
iSlot0 0)
            {
                
RemovePlayerItem(clientiSlot0);
                
AcceptEntityInput(iSlot0"Kill");
            }
            if (
iSlot2 0)
            {
                
RemovePlayerItem(clientiSlot2);
                
AcceptEntityInput(iSlot2"Kill");
            }
            if (
iSlot3 0)
            {
                
RemovePlayerItem(clientiSlot3);
                
AcceptEntityInput(iSlot3"Kill");
            }
            if (
iSlot4 0)
            {
                
RemovePlayerItem(clientiSlot4);
                
AcceptEntityInput(iSlot4"Kill");
            }
        }
    }

    
KickClient(client"Mt");
}

int HxGetSlot1(int &clientint iSlot1)
{
    
sg_buffer0[0] = '\0';
    
GetEntPropString(iSlot1Prop_Data"m_ModelName"sg_buffer0sizeof(sg_buffer0)-1);

    if (
StrContains(sg_buffer0"v_pistolA.mdl"true) != -1)
    {
        
sg_slot1[client] = "pistol";
        return 
1;
    }
    if (
StrContains(sg_buffer0"v_dual_pistolA.mdl"true) != -1)
    {
        
sg_slot1[client] = "dual_pistol";
        return 
1;
    }
    if (
StrContains(sg_buffer0"v_desert_eagle.mdl"true) != -1)
    {
        
sg_slot1[client] = "pistol_magnum";
        return 
1;
    }
    if (
StrContains(sg_buffer0"v_bat.mdl"true) != -1)
    {
        
sg_slot1[client] = "baseball_bat";
        return 
1;
    }
    if (
StrContains(sg_buffer0"v_cricket_bat.mdl"true) != -1)
    {
        
sg_slot1[client] = "cricket_bat";
        return 
1;
    }
    if (
StrContains(sg_buffer0"v_crowbar.mdl"true) != -1)
    {
        
sg_slot1[client] = "crowbar";
        return 
1;
    }
    if (
StrContains(sg_buffer0"v_fireaxe.mdl"true) != -1)
    {
        
sg_slot1[client] = "fireaxe";
        return 
1;
    }
    if (
StrContains(sg_buffer0"v_katana.mdl"true) != -1)
    {
        
sg_slot1[client] = "katana";
        return 
1;
    }
    if (
StrContains(sg_buffer0"v_golfclub.mdl"true) != -1)
    {
        
sg_slot1[client] = "golfclub";
        return 
1;
    }
    if (
StrContains(sg_buffer0"v_machete.mdl"true) != -1)
    {
        
sg_slot1[client] = "machete";
        return 
1;
    }
    if (
StrContains(sg_buffer0"v_tonfa.mdl"true) != -1)
    {
        
sg_slot1[client] = "tonfa";
        return 
1;
    }
    if (
StrContains(sg_buffer0"v_electric_guitar.mdl"true) != -1)
    {
        
sg_slot1[client] = "electric_guitar";
        return 
1;
    }
    if (
StrContains(sg_buffer0"v_frying_pan.mdl"true) != -1)
    {
        
sg_slot1[client] = "frying_pan";
        return 
1;
    }
    if (
StrContains(sg_buffer0"v_chainsaw.mdl"true) != -1)
    {
        
ig_prop1[client] = GetEntProp(iSlot1Prop_Send"m_iClip1"4);
        
sg_slot1[client] = "chainsaw";
        return 
1;
    }
    if (
StrContains(sg_buffer0"v_knife_t.mdl"true) != -1)
    {
        
sg_slot1[client] = "knife";
        return 
1;
    }

    
GetEdictClassname(iSlot1sg_slot1[client], 39);
    
LogError("m_ModelName(%s) %s"sg_buffer0sg_slot1[client]);
    return 
0;
}

void HxSaveC(int &client)
{
    
int iSlot0;
    
int iSlot1;
    
int iSlot2;
    
int iSlot3;
    
int iSlot4;

    if (
GetClientTeam(client) == 2)
    {
        if (
IsPlayerAlive(client))
        {
            

            
iSlot0 GetPlayerWeaponSlot(client0);
            
iSlot1 GetPlayerWeaponSlot(client1);
            
iSlot2 GetPlayerWeaponSlot(client2);
            
iSlot3 GetPlayerWeaponSlot(client3);
            
iSlot4 GetPlayerWeaponSlot(client4);

            if (
iSlot0 0)
            {
                
GetEdictClassname(iSlot0sg_slot0[client], 39);
                
ig_prop0[client] = GetEntProp(iSlot0Prop_Send"m_iClip1"4);
                
ig_prop2[client] = GetEntProp(iSlot0Prop_Send"m_upgradeBitVec"4);
                
ig_prop3[client] = GetEntProp(iSlot0Prop_Send"m_nUpgradedPrimaryAmmoLoaded"4);
                
RemovePlayerItem(clientiSlot0);
                
AcceptEntityInput(iSlot0"Kill");
            }
            if (
iSlot1 0)
            {
                
HxGetSlot1(clientiSlot1);
            }
            if (
iSlot2 0)
            {
                
GetEdictClassname(iSlot2sg_slot2[client], 39);
                
RemovePlayerItem(clientiSlot2);
                
AcceptEntityInput(iSlot2"Kill");
            }
            if (
iSlot3 0)
            {
                
GetEdictClassname(iSlot3sg_slot3[client], 39);
                
RemovePlayerItem(clientiSlot3);
                
AcceptEntityInput(iSlot3"Kill");
            }
            if (
iSlot4 0)
            {
                
GetEdictClassname(iSlot4sg_slot4[client], 39);
                
RemovePlayerItem(clientiSlot4);
                
AcceptEntityInput(iSlot4"Kill");
            }
        }
    }
}

void HxFakeCHEAT(int &client, const char[] sCmd, const char[] sArg)
{
    
int iFlags GetCommandFlags(sCmd);
    
SetCommandFlags(sCmdiFlags & ~FCVAR_CHEAT);
    
FakeClientCommand(client"%s %s"sCmdsArg);
    
SetCommandFlags(sCmdiFlags);
}

void HxGiveC(int &client)
{
    
int iSlot0;
    
int iSlot1;
    
int iSlot2;
    
int iSlot3;
    
int iSlot4;

    if (
IsPlayerAlive(client))
    {
        
iSlot0 GetPlayerWeaponSlot(client0);
        
iSlot1 GetPlayerWeaponSlot(client1);
        
iSlot2 GetPlayerWeaponSlot(client2);
        
iSlot3 GetPlayerWeaponSlot(client3);
        
iSlot4 GetPlayerWeaponSlot(client4);

        if (
iSlot0 0)
        {
            
RemovePlayerItem(clientiSlot0);
            
AcceptEntityInput(iSlot0"Kill");
        }
        if (
iSlot1 0)
        {
            
RemovePlayerItem(clientiSlot1);
            
AcceptEntityInput(iSlot1"Kill");
        }
        if (
iSlot2 0)
        {
            
RemovePlayerItem(clientiSlot2);
            
AcceptEntityInput(iSlot2"Kill");
        }
        if (
iSlot3 0)
        {
            
RemovePlayerItem(clientiSlot3);
            
AcceptEntityInput(iSlot3"Kill");
        }
        if (
iSlot4 0)
        {
            
RemovePlayerItem(clientiSlot4);
            
AcceptEntityInput(iSlot4"Kill");
        }

        if (
sg_slot0[client][0] != '\0')
        {
            
HxFakeCHEAT(client"give"sg_slot0[client]);
            
iSlot0 GetPlayerWeaponSlot(client0);
            
SetEntProp(iSlot0Prop_Send"m_iClip1"ig_prop0[client], 4);
            
SetEntProp(iSlot0Prop_Send"m_upgradeBitVec"ig_prop2[client], 4);
            
SetEntProp(iSlot0Prop_Send"m_nUpgradedPrimaryAmmoLoaded"ig_prop3[client], 4);
        }
        else
        {
            if (
ig_time GetTime())
            {
                
HxFakeCHEAT(client"give""smg_silenced");
                
SetEntProp(GetPlayerWeaponSlot(client0), Prop_Send"m_iClip1"504);
            }
        }

        if (
sg_slot1[client][0] != '\0')
        {
            if (!
strcmp(sg_slot1[client], "dual_pistol"true))
            {
                
HxFakeCHEAT(client"give""pistol");
                
HxFakeCHEAT(client"give""pistol");
            }
            else
            {
                
HxFakeCHEAT(client"give"sg_slot1[client]);
                if (!
strcmp(sg_slot1[client], "chainsaw"true))
                {
                    
iSlot1 GetPlayerWeaponSlot(client1);
                    
SetEntProp(iSlot1Prop_Send"m_iClip1"ig_prop1[client], 4);
                }
            }
        }
        else
        {
            
HxFakeCHEAT(client"give""pistol");
        }

        if (
sg_slot2[client][0] != '\0')
        {
            
HxFakeCHEAT(client"give"sg_slot2[client]);
        }
        if (
sg_slot3[client][0] != '\0')
        {
            
HxFakeCHEAT(client"give"sg_slot3[client]);
        }
        if (
sg_slot4[client][0] != '\0')
        {
            
HxFakeCHEAT(client"give"sg_slot4[client]);
        }
    }
}

public 
Action HxTimerConnected(Handle timerany client)
{
    if (
IsClientInGame(client))
    {
        if (
GetClientTeam(client) == 2)
        {
            if (
IsPlayerAlive(client))
            {
                
HxGiveC(client);
                return 
Plugin_Stop;
            }
        }
        
CreateTimer(2.0HxTimerConnectedclientTIMER_FLAG_NO_MAPCHANGE);
    }

    return 
Plugin_Stop;
}

public 
void OnMapStart()
{
    
HxPrecache();
    
ig_coop HxGameMode();
    if (
ig_coop)
    {
        
SetConVarInt(FindConVar("survivor_respawn_with_guns"), 0falsefalse);
    }

    
ig_protection 0;
    
GetCurrentMap(sg_buffer2sizeof(sg_buffer2)-1);
    if (
StrContains(sg_buffer2"m1_"true) > 1)
    {
        
int i 1;
        while (
<= MaxClients)
        {
            
HxCleaning(i);
            
+= 1;
        }
    }
}

public 
void OnClientPostAdminCheck(int client)
{
    if (!
IsFakeClient(client))
    {
        if (
ig_coop)
        {
            
CreateTimer(5.5HxTimerConnectedclientTIMER_FLAG_NO_MAPCHANGE);
        }
    }
}

public 
void OnClientDisconnect(int client)
{
    if (!
IsFakeClient(client))
    {
        if (!
ig_protection)
        {
            
HxCleaning(client);
        }
    }
}

public 
Action HxTimerRS(Handle timer)
{
    
int i 1;
    while (
<= MaxClients)
    {
        if (
IsClientInGame(i))
        {
            if (
GetClientTeam(i) == 2)
            {
                
HxGiveC(i);
            }
        }
        
+= 1;
    }

    return 
Plugin_Stop;
}

public 
void Event_RoundStart(Event event, const char[] namebool dontBroadcast)
{
    if (
ig_coop)
    {
        
ig_time GetTime() + 45;
        
CreateTimer(1.2HxTimerRS_TIMER_FLAG_NO_MAPCHANGE);
    }
}

public 
void Event_ItemPickup(Event event, const char[] namebool dontBroadcast)
{
    
int iUserid GetClientOfUserId(GetEventInt(event"userid"));
    if (
iUserid 0)
    {
        if (!
IsFakeClient(iUserid))
        {
            
GetEventString(event"item"sg_buffer1sizeof(sg_buffer1)-1);
            if (!
strcmp(sg_buffer1"pistol_magnum"true))
            {
                
sg_defib[iUserid] = "pistol_magnum";
            }
            if (!
strcmp(sg_buffer1"chainsaw"true))
            {
                
sg_defib[iUserid] = "chainsaw";
            }
            if (!
strcmp(sg_buffer1"melee"true))
            {
                
int iSlot1 GetPlayerWeaponSlot(iUserid1);
                if (
iSlot1 0)
                {
                    
GetEntPropString(iSlot1Prop_Data"m_strMapSetScriptName"sg_defib[iUserid], 39);
                }
            }
        }
    }
}

public 
Action HxTimerDefib(Handle timerany client)
{
    if (
IsClientInGame(client))
    {
        if (
GetClientTeam(client) == 2)
        {
            if (
IsPlayerAlive(client))
            {
                if (
sg_defib[client][0] != '\0')
                {
                    
int iSlot1 GetPlayerWeaponSlot(client1);
                    if (
iSlot1 0)
                    {
                        
RemovePlayerItem(clientiSlot1);
                        
AcceptEntityInput(iSlot1"Kill");
                    }
                    
HxFakeCHEAT(client"give"sg_defib[client]);
                }
            }
        }
    }

    return 
Plugin_Stop;
}

public 
void Event_DefibUsed(Event event, const char[] namebool dontBroadcast)
{
    
int iSubject GetClientOfUserId(GetEventInt(event"subject"));
    if (
iSubject 0)
    {
        if (
ig_coop)
        {
            
CreateTimer(1.0HxTimerDefibiSubjectTIMER_FLAG_NO_MAPCHANGE);
        }
    }
}

public 
void Event_MapTransition(Event event, const char[] namebool dontBroadcast)
{
    
int i 1;
    
ig_protection 1;

    if (
ig_coop)
    {
        while (
<= MaxClients)
        {
            if (
IsClientInGame(i))
            {
                
HxCleaning(i);
                if (
IsFakeClient(i))
                {
                    
HxKickC(i);
                }
                else
                {
                    
HxSaveC(i);
                }
            }
            
+= 1;
        }
    }

https://github.com/TyUser/l4d2_ty_sa...aveweapon_4.sp
dr_lex is offline
myljach
Member
Join Date: Jul 2016
Location: Croatia
Old 09-27-2020 , 07:29   Re: L4D2 - The Last Stand Update - Issues and Bugs - Mega Thread
#140

Hello!

My 2 Coop servers after update works fine, all with around 80 plugins, and 170 custom maps(i test only few). Only 1 plugin is not work in my versus server, because is old, and newer SM 1.10.0.6461 not support it. So anione may recommend similar plugin? Is l4d2scores.smx --- https://forums.alliedmods.net/showthread.php?t=113188

Thanks in advance,
M.

Last edited by myljach; 09-27-2020 at 07:29.
myljach is offline
Closed Thread



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 12:18.


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