hello, I need help with this problem and I have been trying to make the models of the blu team robots but of these models that are archived and are from the "Enhanced-est Bots" and I have tried to change the models (it is from stop that tank mode)
And I haven't been able to do it, can anyone help me?
Here's the code part of the model
Code:
bool g_bEnabled = true;
char g_strModelRobots[][] = {
"", // Class 0 (Invalid)
"models/bots_v2/player/scout.mdl", // Class 1 (Scout)
"models/bots_v2/player/sniper.mdl", // Class 2 (Sniper)
"models/bots_v2/player/soldier.mdl", // Class 3 (Soldier)
"models/bots_v2/player/demo.mdl", // Class 4 (Demoman)
"models/bots_v2/player/medic.mdl", // Class 5 (Medic)
"models/bots_v2/player/heavy.mdl", // Class 6 (Heavy)
"models/bots_v2/player/pyro.mdl", // Class 7 (Pyro)
"models/bots_v2/player/spy.mdl", // Class 8 (Spy)
"models/bots_v2/player/engineer.mdl" // Class 9 (Engineer)
};
int g_iModelIndexRobots[sizeof(g_strModelRobots)];
char g_strModelHumans[][] = {"", "models/player/scout.mdl", "models/player/sniper.mdl", "models/player/soldier.mdl", "models/player/demo.mdl", "models/player/medic.mdl", "models/player/heavy.mdl", "models/player/pyro.mdl", "models/player/spy.mdl", "models/player/engineer.mdl"};
int g_iModelIndexHumans[sizeof(g_strModelHumans)];
public void OnMapStart()
{
// Precache robot models
for(int i=0; i<sizeof(g_strModelRobots); i++) g_iModelIndexRobots[i] = Tank_PrecacheModel(g_strModelRobots[i]);
// Precache human player model indices
for(int i=0; i<sizeof(g_strModelHumans); i++) g_iModelIndexHumans[i] = Tank_PrecacheModel(g_strModelHumans[i]);
}
void Robot_Toggle(int client, bool bEnable)
{
if(bEnable)
{
// Make the player into a robot
SetVariantString(g_strModelRobots[TF2_GetPlayerClass(client)]);
AcceptEntityInput(client, "SetCustomModel");
SetEntProp(client, Prop_Send, "m_bUseClassAnimations", 1);
// Fix BLU spies appearing RED to teammates while disguised
/*
new team = GetClientTeam(client);
if(g_nGameMode != GameMode_Race)
{
if(team == TFTeam_Blue && TF2_GetPlayerClass(client) == TFClass_Spy)
{
SetEntProp(client, Prop_Send, "m_bForcedSkin", true);
SetEntProp(client, Prop_Send, "m_nForcedSkin", team-2);
}else{
SetEntProp(client, Prop_Send, "m_bForcedSkin", false);
SetEntProp(client, Prop_Send, "m_nForcedSkin", 0);
}
}else{
SetEntProp(client, Prop_Send, "m_bForcedSkin", false);
SetEntProp(client, Prop_Send, "m_nForcedSkin", 0);
}
*/
}else{
// Return the player back to normal
SetVariantString("");
AcceptEntityInput(client, "SetCustomModel");
SetEntProp(client, Prop_Send, "m_bUseClassAnimations", 0);
/*
SetEntProp(client, Prop_Send, "m_bForcedSkin", false);
SetEntProp(client, Prop_Send, "m_nForcedSkin", 0);
*/
}
}