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

[CS:GO] Hide new arms?


Post New Thread Reply   
 
Thread Tools Display Modes
rogeraabbccdd
Veteran Member
Join Date: Jun 2015
Location: de_dust2
Old 02-14-2017 , 07:17   Re: [CS:GO] Hide new arms?
Reply With Quote #191

Quote:
Originally Posted by andi67 View Post
Ok , IŽll post here what I have done till now. I canŽt guarantee that it works on every map , there might be some issues , take what you need but if you got it fixed with pieces of this , you have to post the solution here.
Will this work for all maps if I add all default models?
Spoiler
__________________

Please keep in mind, nobody have responsibility to help you, especially who don't try to Google first.
I only read messages in Chinese and English.

GitHub | Discord:Kento#2118
rogeraabbccdd is offline
andi67
Veteran Member
Join Date: Mar 2007
Location: Somewhere near you!!!
Old 02-14-2017 , 10:23   Re: [CS:GO] Hide new arms?
Reply With Quote #192

ItŽs more like I posted before:

Code:
char fbiModelsCT[][] = 
{
    "models/player/custom_player/legacy/ctm_fbi.mdl",
    "models/player/custom_player/legacy/ctm_fbi_variantA.mdl",
    "models/player/custom_player/legacy/ctm_fbi_variantB.mdl",
    "models/player/custom_player/legacy/ctm_fbi_variantC.mdl",
    "models/player/custom_player/legacy/ctm_fbi_variantD.mdl"
};

char gignModelsCT[][] = 
{
    "models/player/custom_player/legacy/ctm_gign.mdl",
    "models/player/custom_player/legacy/ctm_gign_variantA.mdl",
    "models/player/custom_player/legacy/ctm_gign_variantB.mdl",
    "models/player/custom_player/legacy/ctm_gign_variantC.mdl",
    "models/player/custom_player/legacy/ctm_gign_variantD.mdl"    
};



public Action Event_Spawn(Event gEventHook, const char[] gEventName, bool iDontBroadcast) 
{
    int client = GetClientOfUserId(gEventHook.GetInt("userid"));
    
    if (isValidClient(client) && IsPlayerAlive(client) && !IsFakeClient(client))
    {            
        int team = GetClientTeam(client);        
            
        if (team == 3) 
        {            
            char sModelCT[128];
             GetEntPropString(client, Prop_Data, "m_ModelName", sModelCT, sizeof(sModelCT));
            

            for (int i = 0; i < sizeof(fbiModelsCT); i++) 
            {
                if (StrEqual(fbiModelsCT[i], sModelCT))
                {
                        SetEntityModel(client,gignModelsCT[GetRandomInt(0 , -1)]);
                     SetEntPropString(client, Prop_Send, "m_szArmsModel", "models/player/custom_player/superheroes/ultron/ultron_arms.mdl");
                      CreateTimer(1.5, PlayerModel, client);                
                }
            }        
            for (int j = 0; j < sizeof(gignModelsCT); j++) 
            {            
                if (StrEqual(gignModelsCT[j], sModelCT))
                {
                    SetEntityModel(client,fbiModelsCT[GetRandomInt(0 , -1)]);             
                     SetEntPropString(client, Prop_Send, "m_szArmsModel", "models/player/custom_player/superheroes/ultron/ultron_arms.mdl");    
                      CreateTimer(1.5, PlayerModel, client);                
                }
            }
      }
}

You have to do this for all models(sas/swat/st6/idf ect.) and than check as ex. if the gign replaces the swat correctly witout overlapping and so on(like trial and error).
__________________
Waiting for HL3,Day of Defeat3 ,but will it ever come? So I'm gonna play COD WW2.>>>>SM_SKINCHOOSER<<<<
>>You need Models for DODS/CSS/CSGO , than click here!!!<<
andi67 is offline
andi67
Veteran Member
Join Date: Mar 2007
Location: Somewhere near you!!!
Old 02-18-2017 , 08:23   Re: [CS:GO] Hide new arms?
Reply With Quote #193

So here is my final solution for replacing the Arm- and Playermodels:

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

#pragma newdecls required


char anarchistModelsT[][] = 
{
    "models/player/custom_player/legacy/tm_anarchist.mdl",
    "models/player/custom_player/legacy/tm_anarchist_variantA.mdl",
    "models/player/custom_player/legacy/tm_anarchist_variantB.mdl",
    "models/player/custom_player/legacy/tm_anarchist_variantC.mdl",
    "models/player/custom_player/legacy/tm_anarchist_variantD.mdl"
};

char balkanModelsT[][] = 
{ 
    "models/player/custom_player/legacy/tm_balkan_variantA.mdl",
    "models/player/custom_player/legacy/tm_balkan_variantB.mdl",
    "models/player/custom_player/legacy/tm_balkan_variantC.mdl",
    "models/player/custom_player/legacy/tm_balkan_variantD.mdl",
    "models/player/custom_player/legacy/tm_balkan_variantE.mdl"
};

char leetModelsT[][] = 
{     
    "models/player/custom_player/legacy/tm_leet_variantA.mdl",
    "models/player/custom_player/legacy/tm_leet_variantB.mdl",
    "models/player/custom_player/legacy/tm_leet_variantC.mdl",
    "models/player/custom_player/legacy/tm_leet_variantD.mdl",
    "models/player/custom_player/legacy/tm_leet_variantE.mdl"
};

char phoenixModelsT[][] = 
{ 
    "models/player/custom_player/legacy/tm_phoenix.mdl",
    "models/player/custom_player/legacy/tm_phoenix_heavy.mdl",    
    "models/player/custom_player/legacy/tm_phoenix_variantA.mdl",
    "models/player/custom_player/legacy/tm_phoenix_variantB.mdl",
    "models/player/custom_player/legacy/tm_phoenix_variantC.mdl",
    "models/player/custom_player/legacy/tm_phoenix_variantD.mdl"
};

char pirateModelsT[][] = 
{ 
    "models/player/custom_player/legacy/tm_pirate.mdl",    
    "models/player/custom_player/legacy/tm_pirate_variantA.mdl",
    "models/player/custom_player/legacy/tm_pirate_variantB.mdl",
    "models/player/custom_player/legacy/tm_pirate_variantC.mdl",
    "models/player/custom_player/legacy/tm_pirate_variantD.mdl"
};

char professionalModelsT[][] = 
{ 
    "models/player/custom_player/legacy/tm_professional.mdl",    
    "models/player/custom_player/legacy/tm_professional_var1.mdl",
    "models/player/custom_player/legacy/tm_professional_var2.mdl",
    "models/player/custom_player/legacy/tm_professional_var3.mdl",
    "models/player/custom_player/legacy/tm_professional_var4.mdl"
};

char separatistModelsT[][] = 
{ 
    "models/player/custom_player/legacy/tm_separatist.mdl",    
    "models/player/custom_player/legacy/tm_separatist_variantA.mdl",
    "models/player/custom_player/legacy/tm_separatist_variantB.mdl",
    "models/player/custom_player/legacy/tm_separatist_variantC.mdl",
    "models/player/custom_player/legacy/tm_separatist_variantD.mdl"
};

char fbiModelsCT[][] = 
{
    "models/player/custom_player/legacy/ctm_fbi.mdl",
    "models/player/custom_player/legacy/ctm_fbi_variantA.mdl",
    "models/player/custom_player/legacy/ctm_fbi_variantB.mdl",
    "models/player/custom_player/legacy/ctm_fbi_variantC.mdl",
    "models/player/custom_player/legacy/ctm_fbi_variantD.mdl"
};

char gignModelsCT[][] = 
{
    "models/player/custom_player/legacy/ctm_gign.mdl",
    "models/player/custom_player/legacy/ctm_gign_variantA.mdl",
    "models/player/custom_player/legacy/ctm_gign_variantB.mdl",
    "models/player/custom_player/legacy/ctm_gign_variantC.mdl",
    "models/player/custom_player/legacy/ctm_gign_variantD.mdl"    
};

char gsg9ModelsCT[][] = 
{
    "models/player/custom_player/legacy/ctm_gsg9.mdl",
    "models/player/custom_player/legacy/ctm_gsg9_variantA.mdl",
    "models/player/custom_player/legacy/ctm_gsg9_variantB.mdl",
    "models/player/custom_player/legacy/ctm_gsg9_variantC.mdl",
    "models/player/custom_player/legacy/ctm_gsg9_variantD.mdl"    
};

char idfModelsCT[][] = 
{
    "models/player/custom_player/legacy/ctm_idf.mdl",
    "models/player/custom_player/legacy/ctm_idf_variantA.mdl",
    "models/player/custom_player/legacy/ctm_idf_variantB.mdl",
    "models/player/custom_player/legacy/ctm_idf_variantC.mdl",
    "models/player/custom_player/legacy/ctm_idf_variantD.mdl",    
    "models/player/custom_player/legacy/ctm_idf_variantE.mdl",
    "models/player/custom_player/legacy/ctm_idf_variantF.mdl"    
};

char sasModelsCT[][] = 
{
    "models/player/custom_player/legacy/ctm_sas.mdl",
    "models/player/custom_player/legacy/ctm_sas_variantA.mdl",
    "models/player/custom_player/legacy/ctm_sas_variantB.mdl",
    "models/player/custom_player/legacy/ctm_sas_variantC.mdl",
    "models/player/custom_player/legacy/ctm_sas_variantD.mdl",    
    "models/player/custom_player/legacy/ctm_sas_variantE.mdl"    
};

char st6ModelsCT[][] = 
{
    "models/player/custom_player/legacy/ctm_st6.mdl",
    "models/player/custom_player/legacy/ctm_st6_variantA.mdl",
    "models/player/custom_player/legacy/ctm_st6_variantB.mdl",
    "models/player/custom_player/legacy/ctm_st6_variantC.mdl",
    "models/player/custom_player/legacy/ctm_st6_variantD.mdl"
};

char swatModelsCT[][] = 
{
    "models/player/custom_player/legacy/ctm_swat.mdl",
    "models/player/custom_player/legacy/ctm_swat_variantA.mdl",
    "models/player/custom_player/legacy/ctm_swat_variantB.mdl",
    "models/player/custom_player/legacy/ctm_swat_variantC.mdl",
    "models/player/custom_player/legacy/ctm_swat_variantD.mdl"
};


public void OnConfigsExecuted() 
{    
    for (int i = 0; i < sizeof(fbiModelsCT); i++) 
    {
        if(fbiModelsCT[i][0] && !IsModelPrecached(fbiModelsCT[i]))
            PrecacheModel(fbiModelsCT[i]);
    }
    
    for (int i = 0; i < sizeof(gignModelsCT); i++) 
    {
        if(gignModelsCT[i][0] && !IsModelPrecached(gignModelsCT[i]))
            PrecacheModel(gignModelsCT[i]);
    }    
    
    for (int i = 0; i < sizeof(anarchistModelsT); i++) 
    {
        if(anarchistModelsT[i][0] && !IsModelPrecached(anarchistModelsT[i]))
            PrecacheModel(anarchistModelsT[i]);
    }    
    
    for (int i = 0; i < sizeof(phoenixModelsT); i++) 
    {
        if(phoenixModelsT[i][0] && !IsModelPrecached(phoenixModelsT[i]))
            PrecacheModel(phoenixModelsT[i]);
    }
    
    for (int i = 0; i < sizeof(pirateModelsT); i++) 
    {
        if(pirateModelsT[i][0] && !IsModelPrecached(pirateModelsT[i]))
            PrecacheModel(pirateModelsT[i]);
    }
    // Precache the default Armmodels for T&CT
    PrecacheModel("models/weapons/t_arms.mdl");
    PrecacheModel("models/weapons/ct_arms.mdl");    
    
    // Precache the Custom Arm- and Playermodels
    PrecacheModel("models/player/custom_player/superheroes/ultron/ultron_arms.mdl");
    PrecacheModel("models/player/custom_player/superheroes/ultron/ultron.mdl");    
    PrecacheModel("models/player/custom_player/superheroes/black_panther/black_panther_arms.mdl");
    PrecacheModel("models/player/custom_player/superheroes/black_panther/black_panther.mdl");        
}

public void OnPluginStart() 
{
    HookEvent("player_spawn", Event_Spawn, EventHookMode_Post);
} 

public Action Event_Spawn(Event gEventHook, const char[] gEventName, bool iDontBroadcast) 
{
    int client = GetClientOfUserId(gEventHook.GetInt("userid"));
    
    if (isValidClient(client) && IsPlayerAlive(client) && !IsFakeClient(client))
    {            
        int team = GetClientTeam(client);        

        if (team == 2) 
        {            
            char sModelT[128];
             GetEntPropString(client, Prop_Data, "m_ModelName", sModelT, sizeof(sModelT)); // Get the complete Modelname.
            PrintToChat(client, "Modelname is : %s", sModelT);
            
            // Now loop through the team2 arrays and check if the Modelname is in it , if yes we set a differant Model that is compatibel with the map.
            for (int a = 0; a < sizeof(anarchistModelsT); a++) 
            {
                if (StrEqual(anarchistModelsT[a], sModelT))
                {
                        SetEntityModel(client,pirateModelsT[GetRandomInt(0 , -1)]);
                  }                      
            } 
            for (int b = 0; b < sizeof(phoenixModelsT); b++) 
            {
                if (StrEqual(phoenixModelsT[b], sModelT))
                {
                        SetEntityModel(client,pirateModelsT[GetRandomInt(0 , -1)]);
                  }                      
            } 
            for (int c = 0; c < sizeof(balkanModelsT); c++) 
            {
                if (StrEqual(balkanModelsT[c], sModelT))
                {
                        SetEntityModel(client,anarchistModelsT[GetRandomInt(0 , -1)]);    
                  }                      
            }    
            for (int d = 0; d < sizeof(leetModelsT); d++) 
            {
                if (StrEqual(leetModelsT[d], sModelT))
                {
                        SetEntityModel(client,anarchistModelsT[GetRandomInt(0 , -1)]);    
                  }                      
            }
            for (int e = 0; e < sizeof(pirateModelsT); e++) 
            {
                if (StrEqual(pirateModelsT[e], sModelT))
                {
                        SetEntityModel(client,anarchistModelsT[GetRandomInt(0 , -1)]);    
                  }                      
            }    
            for (int f = 0; f < sizeof(professionalModelsT); f++) 
            {
                if (StrEqual(professionalModelsT[f], sModelT))
                {
                        SetEntityModel(client,anarchistModelsT[GetRandomInt(0 , -1)]);    
                  }                      
            }
            for (int h = 0; h < sizeof(separatistModelsT); h++) 
            {
                if (StrEqual(separatistModelsT[h], sModelT))
                {
                        SetEntityModel(client,anarchistModelsT[GetRandomInt(0 , -1)]);    
                  }                      
            }
             SetEntPropString(client, Prop_Send, "m_szArmsModel", "models/weapons/t_arms.mdl");        // First set default Armsmodel.
             SetEntPropString(client, Prop_Send, "m_szArmsModel", "models/player/custom_player/superheroes/ultron/ultron_arms.mdl"); // Now we can replace the default Armmodel with our Custom one.
              CreateTimer(1.5, PlayerModel, client);        // Create Timer with delay before setting the new Playermodel.    
        } 
        // Now loop through the team3 arrays and check if the Modelname is in it , if yes we set a differant Model that is compatibel with the map.        
        else if (team == 3) 
        {            
            char sModelCT[128];
             GetEntPropString(client, Prop_Data, "m_ModelName", sModelCT, sizeof(sModelCT));
            PrintToChat(client, "Modelname is : %s", sModelCT);

            for (int i = 0; i < sizeof(fbiModelsCT); i++) 
            {
                if (StrEqual(fbiModelsCT[i], sModelCT))
                {
                       SetEntityModel(client,gignModelsCT[GetRandomInt(0 , -1)]);                
                }
            }        
            for (int j = 0; j < sizeof(gsg9ModelsCT); j++) 
            {            
                if (StrEqual(gsg9ModelsCT[j], sModelCT))
                {
                    SetEntityModel(client,fbiModelsCT[GetRandomInt(0 , -1)]);                                
                }
            }    
            for (int k = 0; k < sizeof(gignModelsCT); k++) 
            {
                if (StrEqual(gignModelsCT[k], sModelCT))
                {
                        SetEntityModel(client,fbiModelsCT[GetRandomInt(0 , -1)]);                
                }
            }
            for (int l = 0; l < sizeof(idfModelsCT); l++) 
            {
                if (StrEqual(idfModelsCT[l], sModelCT))
                {
                        SetEntityModel(client,fbiModelsCT[GetRandomInt(0 , -1)]);                
                }
            }
            for (int m = 0; m < sizeof(sasModelsCT); m++) 
            {
                if (StrEqual(sasModelsCT[m], sModelCT))
                {
                        SetEntityModel(client,gignModelsCT[GetRandomInt(0 , -1)]);                
                }
            }    
            for (int n = 0; n < sizeof(st6ModelsCT); n++) 
            {
                if (StrEqual(st6ModelsCT[n], sModelCT))
                {
                        SetEntityModel(client,fbiModelsCT[GetRandomInt(0 , -1)]);                
                }
            }    
            for (int o = 0; o < sizeof(swatModelsCT); o++) 
            {
                if (StrEqual(swatModelsCT[o], sModelCT))
                {
                        SetEntityModel(client,gignModelsCT[GetRandomInt(0 , -1)]);                
                }
            }
             SetEntPropString(client, Prop_Send, "m_szArmsModel", "models/weapons/ct_arms.mdl");            // First set default Armsmodel.        
             SetEntPropString(client, Prop_Send, "m_szArmsModel", "models/player/custom_player/superheroes/black_panther/black_panther_arms.mdl"); // Now we can replace the default Armmodel with our Custom one.
              CreateTimer(1.5, PlayerModel, client);        // Create Timer with delay before setting the new Playermodel.
        } 
    }
    return Plugin_Continue;
}

public Action PlayerModel(Handle timer ,any client)
{
    if(GetClientTeam(client) == 2)
    {
        // Set the Custom Playermodel.
        SetEntityModel(client,"models/player/custom_player/superheroes/ultron/ultron.mdl");    
    }
    else if(GetClientTeam(client) == 3)
    {
        // Set the Custom Playermodel.        
        SetEntityModel(client,"models/player/custom_player/superheroes/black_panther/black_panther.mdl");    
    }    
}

bool isValidClient(int client, bool bot = false) 
{
    if (client > 0 && client <= MaxClients && IsClientConnected(client) && IsClientInGame(client) && (bot ? IsFakeClient(client) : !IsFakeClient(client))) 
        return true;
    return false;
}
Hopefully this work for a while before Valve will destroy it again.
__________________
Waiting for HL3,Day of Defeat3 ,but will it ever come? So I'm gonna play COD WW2.>>>>SM_SKINCHOOSER<<<<
>>You need Models for DODS/CSS/CSGO , than click here!!!<<
andi67 is offline
OSWO
Senior Member
Join Date: Jul 2015
Location: United Kingdom, London
Old 02-18-2017 , 11:57   Re: [CS:GO] Hide new arms?
Reply With Quote #194

Why use a Timer when you can RequestFrame?
__________________
SourceTimer | WeaponSkins++ | BasePlugins++ https://github.com/OSCAR-WOS
OSWO is offline
andi67
Veteran Member
Join Date: Mar 2007
Location: Somewhere near you!!!
Old 02-18-2017 , 13:08   Re: [CS:GO] Hide new arms?
Reply With Quote #195

You could try it out yourself and see what works better for you.....
__________________
Waiting for HL3,Day of Defeat3 ,but will it ever come? So I'm gonna play COD WW2.>>>>SM_SKINCHOOSER<<<<
>>You need Models for DODS/CSS/CSGO , than click here!!!<<
andi67 is offline
brunoronning
Senior Member
Join Date: Jan 2014
Location: Brazil
Old 03-29-2017 , 16:21   Re: [CS:GO] Hide new arms?
Reply With Quote #196

Quote:
Originally Posted by andi67 View Post
So here is my final solution for replacing the Arm- and Playermodels:

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

#pragma newdecls required


char anarchistModelsT[][] = 
{
    "models/player/custom_player/legacy/tm_anarchist.mdl",
    "models/player/custom_player/legacy/tm_anarchist_variantA.mdl",
    "models/player/custom_player/legacy/tm_anarchist_variantB.mdl",
    "models/player/custom_player/legacy/tm_anarchist_variantC.mdl",
    "models/player/custom_player/legacy/tm_anarchist_variantD.mdl"
};

char balkanModelsT[][] = 
{ 
    "models/player/custom_player/legacy/tm_balkan_variantA.mdl",
    "models/player/custom_player/legacy/tm_balkan_variantB.mdl",
    "models/player/custom_player/legacy/tm_balkan_variantC.mdl",
    "models/player/custom_player/legacy/tm_balkan_variantD.mdl",
    "models/player/custom_player/legacy/tm_balkan_variantE.mdl"
};

char leetModelsT[][] = 
{     
    "models/player/custom_player/legacy/tm_leet_variantA.mdl",
    "models/player/custom_player/legacy/tm_leet_variantB.mdl",
    "models/player/custom_player/legacy/tm_leet_variantC.mdl",
    "models/player/custom_player/legacy/tm_leet_variantD.mdl",
    "models/player/custom_player/legacy/tm_leet_variantE.mdl"
};

char phoenixModelsT[][] = 
{ 
    "models/player/custom_player/legacy/tm_phoenix.mdl",
    "models/player/custom_player/legacy/tm_phoenix_heavy.mdl",    
    "models/player/custom_player/legacy/tm_phoenix_variantA.mdl",
    "models/player/custom_player/legacy/tm_phoenix_variantB.mdl",
    "models/player/custom_player/legacy/tm_phoenix_variantC.mdl",
    "models/player/custom_player/legacy/tm_phoenix_variantD.mdl"
};

char pirateModelsT[][] = 
{ 
    "models/player/custom_player/legacy/tm_pirate.mdl",    
    "models/player/custom_player/legacy/tm_pirate_variantA.mdl",
    "models/player/custom_player/legacy/tm_pirate_variantB.mdl",
    "models/player/custom_player/legacy/tm_pirate_variantC.mdl",
    "models/player/custom_player/legacy/tm_pirate_variantD.mdl"
};

char professionalModelsT[][] = 
{ 
    "models/player/custom_player/legacy/tm_professional.mdl",    
    "models/player/custom_player/legacy/tm_professional_var1.mdl",
    "models/player/custom_player/legacy/tm_professional_var2.mdl",
    "models/player/custom_player/legacy/tm_professional_var3.mdl",
    "models/player/custom_player/legacy/tm_professional_var4.mdl"
};

char separatistModelsT[][] = 
{ 
    "models/player/custom_player/legacy/tm_separatist.mdl",    
    "models/player/custom_player/legacy/tm_separatist_variantA.mdl",
    "models/player/custom_player/legacy/tm_separatist_variantB.mdl",
    "models/player/custom_player/legacy/tm_separatist_variantC.mdl",
    "models/player/custom_player/legacy/tm_separatist_variantD.mdl"
};

char fbiModelsCT[][] = 
{
    "models/player/custom_player/legacy/ctm_fbi.mdl",
    "models/player/custom_player/legacy/ctm_fbi_variantA.mdl",
    "models/player/custom_player/legacy/ctm_fbi_variantB.mdl",
    "models/player/custom_player/legacy/ctm_fbi_variantC.mdl",
    "models/player/custom_player/legacy/ctm_fbi_variantD.mdl"
};

char gignModelsCT[][] = 
{
    "models/player/custom_player/legacy/ctm_gign.mdl",
    "models/player/custom_player/legacy/ctm_gign_variantA.mdl",
    "models/player/custom_player/legacy/ctm_gign_variantB.mdl",
    "models/player/custom_player/legacy/ctm_gign_variantC.mdl",
    "models/player/custom_player/legacy/ctm_gign_variantD.mdl"    
};

char gsg9ModelsCT[][] = 
{
    "models/player/custom_player/legacy/ctm_gsg9.mdl",
    "models/player/custom_player/legacy/ctm_gsg9_variantA.mdl",
    "models/player/custom_player/legacy/ctm_gsg9_variantB.mdl",
    "models/player/custom_player/legacy/ctm_gsg9_variantC.mdl",
    "models/player/custom_player/legacy/ctm_gsg9_variantD.mdl"    
};

char idfModelsCT[][] = 
{
    "models/player/custom_player/legacy/ctm_idf.mdl",
    "models/player/custom_player/legacy/ctm_idf_variantA.mdl",
    "models/player/custom_player/legacy/ctm_idf_variantB.mdl",
    "models/player/custom_player/legacy/ctm_idf_variantC.mdl",
    "models/player/custom_player/legacy/ctm_idf_variantD.mdl",    
    "models/player/custom_player/legacy/ctm_idf_variantE.mdl",
    "models/player/custom_player/legacy/ctm_idf_variantF.mdl"    
};

char sasModelsCT[][] = 
{
    "models/player/custom_player/legacy/ctm_sas.mdl",
    "models/player/custom_player/legacy/ctm_sas_variantA.mdl",
    "models/player/custom_player/legacy/ctm_sas_variantB.mdl",
    "models/player/custom_player/legacy/ctm_sas_variantC.mdl",
    "models/player/custom_player/legacy/ctm_sas_variantD.mdl",    
    "models/player/custom_player/legacy/ctm_sas_variantE.mdl"    
};

char st6ModelsCT[][] = 
{
    "models/player/custom_player/legacy/ctm_st6.mdl",
    "models/player/custom_player/legacy/ctm_st6_variantA.mdl",
    "models/player/custom_player/legacy/ctm_st6_variantB.mdl",
    "models/player/custom_player/legacy/ctm_st6_variantC.mdl",
    "models/player/custom_player/legacy/ctm_st6_variantD.mdl"
};

char swatModelsCT[][] = 
{
    "models/player/custom_player/legacy/ctm_swat.mdl",
    "models/player/custom_player/legacy/ctm_swat_variantA.mdl",
    "models/player/custom_player/legacy/ctm_swat_variantB.mdl",
    "models/player/custom_player/legacy/ctm_swat_variantC.mdl",
    "models/player/custom_player/legacy/ctm_swat_variantD.mdl"
};


public void OnConfigsExecuted() 
{    
    for (int i = 0; i < sizeof(fbiModelsCT); i++) 
    {
        if(fbiModelsCT[i][0] && !IsModelPrecached(fbiModelsCT[i]))
            PrecacheModel(fbiModelsCT[i]);
    }
    
    for (int i = 0; i < sizeof(gignModelsCT); i++) 
    {
        if(gignModelsCT[i][0] && !IsModelPrecached(gignModelsCT[i]))
            PrecacheModel(gignModelsCT[i]);
    }    
    
    for (int i = 0; i < sizeof(anarchistModelsT); i++) 
    {
        if(anarchistModelsT[i][0] && !IsModelPrecached(anarchistModelsT[i]))
            PrecacheModel(anarchistModelsT[i]);
    }    
    
    for (int i = 0; i < sizeof(phoenixModelsT); i++) 
    {
        if(phoenixModelsT[i][0] && !IsModelPrecached(phoenixModelsT[i]))
            PrecacheModel(phoenixModelsT[i]);
    }
    
    for (int i = 0; i < sizeof(pirateModelsT); i++) 
    {
        if(pirateModelsT[i][0] && !IsModelPrecached(pirateModelsT[i]))
            PrecacheModel(pirateModelsT[i]);
    }
    // Precache the default Armmodels for T&CT
    PrecacheModel("models/weapons/t_arms.mdl");
    PrecacheModel("models/weapons/ct_arms.mdl");    
    
    // Precache the Custom Arm- and Playermodels
    PrecacheModel("models/player/custom_player/superheroes/ultron/ultron_arms.mdl");
    PrecacheModel("models/player/custom_player/superheroes/ultron/ultron.mdl");    
    PrecacheModel("models/player/custom_player/superheroes/black_panther/black_panther_arms.mdl");
    PrecacheModel("models/player/custom_player/superheroes/black_panther/black_panther.mdl");        
}

public void OnPluginStart() 
{
    HookEvent("player_spawn", Event_Spawn, EventHookMode_Post);
} 

public Action Event_Spawn(Event gEventHook, const char[] gEventName, bool iDontBroadcast) 
{
    int client = GetClientOfUserId(gEventHook.GetInt("userid"));
    
    if (isValidClient(client) && IsPlayerAlive(client) && !IsFakeClient(client))
    {            
        int team = GetClientTeam(client);        

        if (team == 2) 
        {            
            char sModelT[128];
             GetEntPropString(client, Prop_Data, "m_ModelName", sModelT, sizeof(sModelT)); // Get the complete Modelname.
            PrintToChat(client, "Modelname is : %s", sModelT);
            
            // Now loop through the team2 arrays and check if the Modelname is in it , if yes we set a differant Model that is compatibel with the map.
            for (int a = 0; a < sizeof(anarchistModelsT); a++) 
            {
                if (StrEqual(anarchistModelsT[a], sModelT))
                {
                        SetEntityModel(client,pirateModelsT[GetRandomInt(0 , -1)]);
                  }                      
            } 
            for (int b = 0; b < sizeof(phoenixModelsT); b++) 
            {
                if (StrEqual(phoenixModelsT[b], sModelT))
                {
                        SetEntityModel(client,pirateModelsT[GetRandomInt(0 , -1)]);
                  }                      
            } 
            for (int c = 0; c < sizeof(balkanModelsT); c++) 
            {
                if (StrEqual(balkanModelsT[c], sModelT))
                {
                        SetEntityModel(client,anarchistModelsT[GetRandomInt(0 , -1)]);    
                  }                      
            }    
            for (int d = 0; d < sizeof(leetModelsT); d++) 
            {
                if (StrEqual(leetModelsT[d], sModelT))
                {
                        SetEntityModel(client,anarchistModelsT[GetRandomInt(0 , -1)]);    
                  }                      
            }
            for (int e = 0; e < sizeof(pirateModelsT); e++) 
            {
                if (StrEqual(pirateModelsT[e], sModelT))
                {
                        SetEntityModel(client,anarchistModelsT[GetRandomInt(0 , -1)]);    
                  }                      
            }    
            for (int f = 0; f < sizeof(professionalModelsT); f++) 
            {
                if (StrEqual(professionalModelsT[f], sModelT))
                {
                        SetEntityModel(client,anarchistModelsT[GetRandomInt(0 , -1)]);    
                  }                      
            }
            for (int h = 0; h < sizeof(separatistModelsT); h++) 
            {
                if (StrEqual(separatistModelsT[h], sModelT))
                {
                        SetEntityModel(client,anarchistModelsT[GetRandomInt(0 , -1)]);    
                  }                      
            }
             SetEntPropString(client, Prop_Send, "m_szArmsModel", "models/weapons/t_arms.mdl");        // First set default Armsmodel.
             SetEntPropString(client, Prop_Send, "m_szArmsModel", "models/player/custom_player/superheroes/ultron/ultron_arms.mdl"); // Now we can replace the default Armmodel with our Custom one.
              CreateTimer(1.5, PlayerModel, client);        // Create Timer with delay before setting the new Playermodel.    
        } 
        // Now loop through the team3 arrays and check if the Modelname is in it , if yes we set a differant Model that is compatibel with the map.        
        else if (team == 3) 
        {            
            char sModelCT[128];
             GetEntPropString(client, Prop_Data, "m_ModelName", sModelCT, sizeof(sModelCT));
            PrintToChat(client, "Modelname is : %s", sModelCT);

            for (int i = 0; i < sizeof(fbiModelsCT); i++) 
            {
                if (StrEqual(fbiModelsCT[i], sModelCT))
                {
                       SetEntityModel(client,gignModelsCT[GetRandomInt(0 , -1)]);                
                }
            }        
            for (int j = 0; j < sizeof(gsg9ModelsCT); j++) 
            {            
                if (StrEqual(gsg9ModelsCT[j], sModelCT))
                {
                    SetEntityModel(client,fbiModelsCT[GetRandomInt(0 , -1)]);                                
                }
            }    
            for (int k = 0; k < sizeof(gignModelsCT); k++) 
            {
                if (StrEqual(gignModelsCT[k], sModelCT))
                {
                        SetEntityModel(client,fbiModelsCT[GetRandomInt(0 , -1)]);                
                }
            }
            for (int l = 0; l < sizeof(idfModelsCT); l++) 
            {
                if (StrEqual(idfModelsCT[l], sModelCT))
                {
                        SetEntityModel(client,fbiModelsCT[GetRandomInt(0 , -1)]);                
                }
            }
            for (int m = 0; m < sizeof(sasModelsCT); m++) 
            {
                if (StrEqual(sasModelsCT[m], sModelCT))
                {
                        SetEntityModel(client,gignModelsCT[GetRandomInt(0 , -1)]);                
                }
            }    
            for (int n = 0; n < sizeof(st6ModelsCT); n++) 
            {
                if (StrEqual(st6ModelsCT[n], sModelCT))
                {
                        SetEntityModel(client,fbiModelsCT[GetRandomInt(0 , -1)]);                
                }
            }    
            for (int o = 0; o < sizeof(swatModelsCT); o++) 
            {
                if (StrEqual(swatModelsCT[o], sModelCT))
                {
                        SetEntityModel(client,gignModelsCT[GetRandomInt(0 , -1)]);                
                }
            }
             SetEntPropString(client, Prop_Send, "m_szArmsModel", "models/weapons/ct_arms.mdl");            // First set default Armsmodel.        
             SetEntPropString(client, Prop_Send, "m_szArmsModel", "models/player/custom_player/superheroes/black_panther/black_panther_arms.mdl"); // Now we can replace the default Armmodel with our Custom one.
              CreateTimer(1.5, PlayerModel, client);        // Create Timer with delay before setting the new Playermodel.
        } 
    }
    return Plugin_Continue;
}

public Action PlayerModel(Handle timer ,any client)
{
    if(GetClientTeam(client) == 2)
    {
        // Set the Custom Playermodel.
        SetEntityModel(client,"models/player/custom_player/superheroes/ultron/ultron.mdl");    
    }
    else if(GetClientTeam(client) == 3)
    {
        // Set the Custom Playermodel.        
        SetEntityModel(client,"models/player/custom_player/superheroes/black_panther/black_panther.mdl");    
    }    
}

bool isValidClient(int client, bool bot = false) 
{
    if (client > 0 && client <= MaxClients && IsClientConnected(client) && IsClientInGame(client) && (bot ? IsFakeClient(client) : !IsFakeClient(client))) 
        return true;
    return false;
}
Hopefully this work for a while before Valve will destroy it again.
It worked perfectly on my local server (windows), but on my dedicated server (linux) it gets desynchronized setting the arms at the wrong time, etc. Do you know why this is happening?

ps: sorry for my english (Google Translate)

Last edited by brunoronning; 03-29-2017 at 16:22. Reason: edit
brunoronning is offline
idank1NGz
Junior Member
Join Date: Aug 2016
Old 03-30-2017 , 01:06   Re: [CS:GO] Hide new arms?
Reply With Quote #197

use this : here.
idank1NGz is offline
brunoronning
Senior Member
Join Date: Jan 2014
Location: Brazil
Old 03-30-2017 , 12:03   Re: [CS:GO] Hide new arms?
Reply With Quote #198

Quote:
Originally Posted by idank1NGz View Post
use this : here.
Does not work on zombie maps (custom).
brunoronning is offline
andi67
Veteran Member
Join Date: Mar 2007
Location: Somewhere near you!!!
Old 03-30-2017 , 12:45   Re: [CS:GO] Hide new arms?
Reply With Quote #199

The delay between setting armmodel and playermodel is needed , or what exactly do you mean?
__________________
Waiting for HL3,Day of Defeat3 ,but will it ever come? So I'm gonna play COD WW2.>>>>SM_SKINCHOOSER<<<<
>>You need Models for DODS/CSS/CSGO , than click here!!!<<
andi67 is offline
brunoronning
Senior Member
Join Date: Jan 2014
Location: Brazil
Old 03-30-2017 , 12:56   Re: [CS:GO] Hide new arms?
Reply With Quote #200

Quote:
Originally Posted by andi67 View Post
The delay between setting armmodel and playermodel is needed , or what exactly do you mean?
Solved. It is now 85% functional.
What I need to resolve now is to make the arms change when being infected (no respawn).

ps: sorry for my english (google translate )
brunoronning 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 16:12.


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