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

[TF2] Backpack models move to other classes when switching


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Gurrth
Junior Member
Join Date: Feb 2020
Old 02-22-2020 , 02:13   [TF2] Backpack models move to other classes when switching
Reply With Quote #1

Hi all! I'm trying to fix an old plugin, specifically DPErny's "[TF2] CiviMod"

When stripping all weapons as a pyro with an item like the Thermal Thruster, the model shows up when switching classes floating behind them or in the center.



This bug works with other weapons in the Second slot, like the medic's quick fix and so on.

Here's DPErny's Code:


Quote:
PHP Code:
#include <sourcemod>
#include <tf2_stocks>
 
public Plugin:myinfo =
{
    
name "CiviMod",
    
author "DPErny",
    
description "Allows Civilian on any class, any time",
    
version "1.0",
    
url "ubercharged.net/forum/index"
};
 
public 
OnPluginStart()
{
    
LoadTranslations("common.phrases")
    
CreateConVar("sm_civimod_version""1.0""CiviMod Version"FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
    
CreateConVar("civil_all""1""Set to 1 to allow players to Civilize themselves.");
    
AutoExecConfig();
    
    
RegConsoleCmd("sm_civilizeme"command_clcivilize"Makes you into a Civilian");
    
RegAdminCmd("sm_civilize"command_admcivilizeADMFLAG_SLAY"Make anyone Civilian. Note: can be undone through resupply");
}

public 
Action:command_clcivilize(clientargs)
{
    new 
cando FindConVar ("civil_all");

    if (
GetConVarBool(cando))
    {
        if (
TF2_GetPlayerClass(client) != TFClass_Engineer)
        {
            
TF2_RemoveAllWeapons(client);
               
PrintToChat (client"[CiviMod] You have been Civilized. Please note that using a resupply cabinet will uncivilize you.");
               
        }
        
    }
    else
    {
        
PrintToChat (client"[CiviMod] Engineers do not have access to Civilize");
    }  

}

public 
Action:command_admcivilize(clientargs)
{
    new 
String:civitarget[32];
    
GetCmdArg(1civitargetsizeof(civitarget));
    new 
FindTarget(clientcivitarget);

    
TF2_RemoveAllWeapons(i);
    
PrintToChat(i"You have been Civilized.");
    
PrintToChat(i"The target has been Civilized.");


What would be the best way to fix this, as I'm at a loss on how to reset models.

The only way to fix this in-game is to join Spectator and then rejoin as a class.

Last edited by Gurrth; 02-22-2020 at 02:26.
Gurrth 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 20:24.


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