got most of my mods running with 3.0 90% that is still trying to figure which one kills it. If I find out I'll report back. So the test server is live as of now lets see what happens but in the meantime does anyone know where I can get a hl2dm model of darth maul the one I have is for css so doesn't animate correctly?
Massive thanks to andi for great piece of work runs smooth as a dolphins beak!
I'm struggling to get spawn protection working. tried sc_protect and spawnandkillprotect, they work but of course the bots don't spawn because of the delay.
there are 2 links on page one for models, it looks like andi only does css models and they don't animate correctly in deathmatch and the other link has loads of jpg's of models but nothing in the download? go figure. Anyone want to say what program they use to animate the models and I'll do it myself, could be fun! deathmatch model skins are like hens teeth it seems like technow and s-low have gone to that great big model shop in the sky!
4.8 added sm_skinchooser_forceplayerskintimer and sm_skinchooser_skinadmintimer
4.7 Added new Cvar "sm_skinchooser_use_request_frame".
Choose which method you want to use for setting the Armmodels in CSGO ,
removing the weapons and equip them new or simply respawn the player.
4.6 Error Message fixed?
4.5 Really needed?
Added fic for Armsmodels in CSGO.
Updated to new Syntax.
Added more Cvars for customization.
Added CSGO Armmodels support.
Updated SteamId check for matching SteamId3.
Plugin now uses mapbased cnnfigs.
Added more Botchecks , some cosmetic.
Now you can force a skin to Admins automaticly.
Added possebility to restrict the sm_models/!models command by cvar.
Added Timer for Menu closing automaticly.
Changed some cvars from "enabled" to "disabled" by default , seams necessary since some people are not able to read the documentation ,
also changed some code.
Added new Cvar "sm_skinchooser_forceplayerskin" , only works if "sm_skinchooser_playerspawntimer" is set to "1" !!!
This is used to force players become a customskin on Spawn.
Added autocreating configfile on first start.
Update to 2.2
Added Cvar for displaying Menu only for Admins
Added Cvar for Mods like Resistance and Liberation where player_spawn is fired a little bit later so we add an one second timer
to make sure Model is set on spawn.
Update to 2.1:
Added new Cvar sm_skinchooser_admingroup , brings back the old GroupSystem.
Bahhhh amazing now you can use Flags and multiple Groups!!!
Update to 2.0:
New cvar sm_skinchooser_SkinBots , forces Bots to have a skin.
New cvar sm_skinchooser_displaytimer , makes it possible to display the menu a little bit
later not directly by choosing a team.
New cvar sm_skinchooser_menustarttime , here you can modify the time when Menu should be displayed by joining the team
related to sm_skinchooser_displaytimer.
Update to 1.9:
Removed needing of Gamedata.txt , so from now Gamedata.txt is no more needed!!!
Update to 1.8:
Fixed another Handlebug.
Update to 1.7:
Added new Cvar "sm_skinchooser_autodisplay"
Update to 1.6:
Supported now all Flags
Update to 1.5:
Fixed native Handle error
Update to 1.4:
Plugin now handles the following Flags:
"" - for Public
"b" - Generic Admins
"g" - Mapchange Admins
"t" - Custom Admins for use Reserved Skins
"z" - Root Admins
Now you only will see Sections/Groups in the Menu you have Access to
Rearranged skins.ini for better overview
Fixed some Menubugs
Added Gamedata for Hl2mp
Everybody can edit this plugin and copy this plugin.
Thanks to:
Pred,Tigerox,Recon for making Modelmenu
Swat_88 for making sm_downloader and precacher
Paegus,Ghosty for helping me to bring up the Menu on Teamjoin
And special THX to Feuersturm who helped me to fix the Spectatorbug!!!
public void OnPluginEnd()
{
CloseHandle(g_version);
CloseHandle(g_enabled);
}
//public void OnMapStart()
public void OnConfigsExecuted()
{
if(GetConVarInt(g_enabled) == 1)
{
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]);
}
PrecacheModel("models/weapons/t_arms.mdl");
PrecacheModel("models/weapons/ct_arms.mdl");
if(GetConVarInt(g_mapbased) == 1)
{
// Does current map string contains a "workshop" prefix at a start?
if (strncmp(curmap, "workshop", 8) == 0)
{
// If yes - skip the first 19 characters to avoid comparing the "workshop/12345678" prefix
BuildPath(Path_SM, file, sizeof(file), "configs/sm_skinchooser/%s_skins.ini", curmap[19]);
BuildPath(Path_SM, files, sizeof(files), "configs/sm_skinchooser/%s_skins_downloads.ini", curmap[19]);
}
else /* That's not a workshop map */
{
// Let's check that custom skin configuration file is exists for current map
BuildPath(Path_SM, file, sizeof(file), "configs/sm_skinchooser/%s_skins.ini", curmap);
BuildPath(Path_SM, files, sizeof(files), "configs/sm_skinchooser/%s_skins_downloads.ini", curmap);
}
// Unfortunately config for current map is not exists
if (!FileExists(file))
{
// Then use default one
BuildPath(Path_SM, file, sizeof(file), "configs/sm_skinchooser/default_skins.ini");
}
if (!FileExists(files))
{
BuildPath(Path_SM, files, sizeof(files), "configs/sm_skinchooser/default_skins_downloads.ini");
}
public void OnMapEnd()
{
// Write the last choosen Model
char filea[PLATFORM_MAX_PATH];
char fileb[PLATFORM_MAX_PATH];
char curmap[PLATFORM_MAX_PATH];
GetCurrentMap(curmap, sizeof(curmap));
if (!KvGotoFirstSubKey(kv))
{
return;
}
do
{
KvJumpToKey(kv, "Team1");
KvGotoFirstSubKey(kv);
do
{
KvGetString(kv, "path", path, sizeof(path),"");
if (FileExists(path , true))
PrecacheModel(path,true);
}
while (KvGotoNextKey(kv));
KvGoBack(kv);
KvGoBack(kv);
KvJumpToKey(kv, "Team2");
KvGotoFirstSubKey(kv);
do
{
KvGetString(kv, "path", path, sizeof(path),"");
if (FileExists(path , true))
PrecacheModel(path,true);
}
while (KvGotoNextKey(kv));
KvGoBack(kv);
KvGoBack(kv);
}
while (KvGotoNextKey(kv));
if (!KvGotoFirstSubKey(kva))
{
return;
}
do
{
KvJumpToKey(kva, "Team1");
KvGotoFirstSubKey(kva);
do
{
KvGetString(kva, "arms", arms, sizeof(arms),"");
if (FileExists(arms , true))
PrecacheModel(arms,true);
}
while (KvGotoNextKey(kva));
KvGoBack(kva);
KvGoBack(kva);
KvJumpToKey(kva, "Team2");
KvGotoFirstSubKey(kva);
do
{
KvGetString(kva, "arms", arms, sizeof(arms),"");
if (FileExists(arms , true))
PrecacheModel(arms,true);
}
while (KvGotoNextKey(kva));
KvGoBack(kva);
KvGoBack(kva);
}
while (KvGotoNextKey(kva));
KvRewind(kva);
}
Handle BuildMainMenu(int client)
{
/* Create the menu Handle */
Handle menu = CreateMenu(Menu_Group);
if (!KvGotoFirstSubKey(kv))
{
return INVALID_HANDLE;
}
{
do
{
if(GetConVarInt(g_AdminGroup) == 1)
{
// check if they have access
char group[30];
char temp[2];
KvGetString(kv,"Admin",group,sizeof(group));
AdminId AdmId = GetUserAdmin(client);
int count = GetAdminGroupCount(AdmId);
for (int i =0; i<count; i++)
{
if (FindAdmGroup(group) == GetAdminGroup(AdmId, i, temp, sizeof(temp)))
{
// Get the model group name and add it to the menu
KvGetSectionName(kv, buffer, sizeof(buffer));
AddMenuItem(menu,buffer,buffer);
}
}
}
//Get accesFlag and see if the Admin is in it
KvGetString(kv, "admin", accessFlag, sizeof(accessFlag));
public int Menu_Group(Menu menu, MenuAction action, int param1, int param2)
{
// User has selected a model group
if (action == MenuAction_Select)
{
char info[30];
// Get the group they selected
bool found = GetMenuItem(menu, param2, info, sizeof(info));
if (!found)
return;
//tigeox
// Check to see if the user has decided they don't want a model
// (e.g. go to a stock model)%%
if(StrEqual(info,"none"))
{
// Get the player's authid
KvJumpToKey(playermodelskv,authid[param1],true);
// Clear their saved model so that the next time
// they spawn, they are able to use a stock model
if (GetClientTeam(param1) == 2)
{
KvSetString(playermodelskv, "Team1", "");
KvSetString(playermodelskv, "Team1Group", "");
}
else if (GetClientTeam(param1) == 3)
{
KvSetString(playermodelskv, "Team2", "");
KvSetString(playermodelskv, "Team2Group", "");
}
// Rewind the KVs
KvRewind(playermodelskv);
// We don't need to go any further, return
return;
}
// User selected a group
// advance kv to this group
KvJumpToKey(kv, info);
// Check users team
if (GetClientTeam(param1) == 2)
{
// Show team 1 models
KvJumpToKey(kv, "Team1");
}
else if (GetClientTeam(param1) == 3)
{
// Show team 2 models
KvJumpToKey(kv, "Team2");
}
else
// They must be spectator, return
return;
// Get the first model
KvGotoFirstSubKey(kv);
// Create the menu
Handle tempmenu = CreateMenu(Menu_Model);
// Add the models to the menu
char buffer[30];
char path[256];
do
{
// Add the model to the menu
KvGetSectionName(kv, buffer, sizeof(buffer));
KvGetString(kv, "path", path, sizeof(path),"");
AddMenuItem(tempmenu,path,buffer);
}
while (KvGotoNextKey(kv));
// Set the menu title to the model group name
SetMenuTitle(tempmenu, info);
// Rewind the KVs
KvRewind(kv);
// Display the menu
DisplayMenu(tempmenu, param1, MENU_TIME_FOREVER);
}
else if (action == MenuAction_End)
{
CloseHandle(menu);
}
}
public int Menu_Model(Handle menu, MenuAction action, int param1, int param2)
{
// User choose a model
if (action == MenuAction_Select)
{
char info[256];
char group[30];
// Get the model's menu item
bool found = GetMenuItem(menu, param2, info, sizeof(info));
if (!found)
return;
// Set the user's model
if (!StrEqual(info,"") && IsModelPrecached(info) && IsClientConnected(param1))
{
// Set the model
SetEntityModel(param1, info);
}
KvJumpToKey(playermodelskv,authid[param1],true);
// Save the user's choice so it is automatically applied
// each time they spawn
if (GetClientTeam(param1) == 2)
{
KvSetString(playermodelskv, "Team1", info);
KvSetString(playermodelskv, "Team1Group", group);
}
else if (GetClientTeam(param1) == 3)
{
KvSetString(playermodelskv, "Team2", info);
KvSetString(playermodelskv, "Team2Group", group);
}
// Rewind the KVs
KvRewind(playermodelskv);
}
// If Game is not CSGO, close the menu handle else display Armsmenu
if(action == MenuAction_Select)
{
if (StrEqual(Game, "csgo") && GetConVarInt(g_arms_enabled) == 1)
{
CreateTimer(0.1 , CommandSecMenu , param1);
}
else
{
CloseHandle(menu);
}
}
}
public Action CommandSecMenu(Handle timer, any param1)
{
armsmainmenu = BuildArmsMainMenu(param1);
if (armsmainmenu == INVALID_HANDLE)
{
// We don't, send an error message and return
PrintToConsole(param1, "There was an error generating the menu. Check your skins.ini file.");
return Plugin_Handled;
}
{
do
{
if(GetConVarInt(g_AdminGroup) == 1)
{
// check if they have access
char group[30];
char temp[2];
KvGetString(kva,"Admin",group,sizeof(group));
AdminId AdmId = GetUserAdmin(param1);
int count = GetAdminGroupCount(AdmId);
for (int i =0; i<count; i++)
{
if (FindAdmGroup(group) == GetAdminGroup(AdmId, i, temp, sizeof(temp)))
{
// Get the model group name and add it to the menu
KvGetSectionName(kva, buffer, sizeof(buffer));
AddMenuItem(secmenu,buffer,buffer);
}
}
}
//Get accesFlag and see if the Admin is in it
KvGetString(kva, "admin", accessFlag, sizeof(accessFlag));
public int Menu_Arms_Group(Menu secmenu, MenuAction action,int param1, int param2)
{
// User has selected a model group
if (action == MenuAction_Select)
{
char info[30];
// Get the group they selected
bool found = GetMenuItem(secmenu, param2, info, sizeof(info));
if (!found)
return;
//tigeox
// Check to see if the user has decided they don't want a model
// (e.g. go to a stock model)%%
if(StrEqual(info,"none"))
{
// Get the player's authid
KvJumpToKey(playermodelskva,authid[param1],true);
// Clear their saved model so that the next time
// they spawn, they are able to use a stock model
if (GetClientTeam(param1) == 2)
{
KvSetString(playermodelskva, "Team1", "");
KvSetString(playermodelskva, "Team1Group", "");
}
else if (GetClientTeam(param1) == 3)
{
KvSetString(playermodelskva, "Team2", "");
KvSetString(playermodelskva, "Team2Group", "");
}
// Rewind the KVs
KvRewind(playermodelskva);
// We don't need to go any further, return
return;
}
// User selected a group
// advance kv to this group
KvJumpToKey(kva, info);
// Check users team
if (GetClientTeam(param1) == 2)
{
// Show team 1 models
KvJumpToKey(kva, "Team1");
}
else if (GetClientTeam(param1) == 3)
{
// Show team 2 models
KvJumpToKey(kva, "Team2");
}
else
// They must be spectator, return
return;
// Get the first model
KvGotoFirstSubKey(kva);
// Create the menu
Menu atempmenu = CreateMenu(Menu_Arms);
// Add the models to the menu
char buffer[30];
char arms[256];
do
{
// Add the model to the menu
KvGetSectionName(kva, buffer, sizeof(buffer));
KvGetString(kva, "arms", arms, sizeof(arms),"");
AddMenuItem(atempmenu,arms,buffer);
}
while (KvGotoNextKey(kva));
// Set the menu title to the model group name
SetMenuTitle(atempmenu, info);
// Rewind the KVs
KvRewind(kva);
// Display the menu
DisplayMenu(atempmenu, param1, MENU_TIME_FOREVER);
}
else if (action == MenuAction_End)
{
CloseHandle(secmenu);
}
}
public int Menu_Arms(Menu amenu, MenuAction action, int param1,int param2)
{
// User choose a model
if (action == MenuAction_Select)
{
char info[256];
char group[30];
// Get the model's menu item
bool found = GetMenuItem(amenu, param2, info, sizeof(info));
if (!found)
return;
// Set the user's model
if (!StrEqual(info,"") && IsModelPrecached(info) && IsClientConnected(param1))
{
if(IsPlayerAlive(param1))
{
// Set the model
SetEntPropString(param1, Prop_Send, "m_szArmsModel", info);
if(GetConVarInt(g_request_frame) == 1)
{
RequestFrame(Respawn, param1);
}
if(GetConVarInt(g_request_frame) == 0)
{
CreateTimer(0.15, RemoveItemTimer, EntIndexToEntRef(param1), TIMER_FLAG_NO_MAPCHANGE);
}
}
}
// Get the player's steam
KvJumpToKey(playermodelskva,authid[param1], true);
// Save the user's choice so it is automatically applied
// each time they spawn
if (GetClientTeam(param1) == 2)
{
KvSetString(playermodelskva, "Team1", info);
KvSetString(playermodelskva, "Team1Group", group);
}
else if (GetClientTeam(param1) == 3)
{
KvSetString(playermodelskva, "Team2", info);
KvSetString(playermodelskva, "Team2Group", group);
}
// Rewind the KVs
KvRewind(playermodelskva);
}
// If they picked exit, close the menu handle
if (action == MenuAction_End)
{
CloseHandle(amenu);
}
}
public Action Timer_Menu(Handle timer, any client)
{
if(GetClientTeam(client) == 2 || GetClientTeam(client) == 3 && IsValidClient(client))
{
Command_Model(client, 0);
}
mainmenu = BuildMainMenu(client);
if (mainmenu == INVALID_HANDLE)
{
// We don't, send an error message and return
PrintToConsole(client, "There was an error generating the menu. Check your skins.ini file.");
return Plugin_Handled;
}
DisplayMenu(mainmenu, client, GetConVarInt(g_CloseMenuTimer));
PrintToChat(client, "Skinmenu is open , choose your Model!!!");
return Plugin_Handled;
}
if(curCount <= GetConVarInt(g_CommandCounts))
{
//Create the main menu
mainmenu = BuildMainMenu(client);
// Do we have a valid model menu
if (mainmenu == INVALID_HANDLE)
{
// We don't, send an error message and return
PrintToConsole(client, "There was an error generating the menu. Check your skins.ini file.");
return Plugin_Handled;
}
AdminId admin = GetUserAdmin(client);
if (GetConVarInt(g_AdminOnly) == 1 && admin != INVALID_ADMIN_ID)
{
// We have a valid menu, display it and return
DisplayMenu(mainmenu, client, GetConVarInt(g_CloseMenuTimer));
}
else if(GetConVarInt(g_AdminOnly) == 0)
{
DisplayMenu(mainmenu, client, GetConVarInt(g_CloseMenuTimer));
}
}
}
else if(GetConVarInt(g_CommandCountsEnabled) == 0)
{
//Create the main menu
mainmenu = BuildMainMenu(client);
// Do we have a valid model menu
if (mainmenu == INVALID_HANDLE)
{
// We don't, send an error message and return
PrintToConsole(client, "There was an error generating the menu. Check your skins.ini file.");
return Plugin_Handled;
}
AdminId admin = GetUserAdmin(client);
if (GetConVarInt(g_AdminOnly) == 1 && admin != INVALID_ADMIN_ID)
{
// We have a valid menu, display it and return
DisplayMenu(mainmenu, client, GetConVarInt(g_CloseMenuTimer));
}
else if(GetConVarInt(g_AdminOnly) == 0)
{
DisplayMenu(mainmenu, client, GetConVarInt(g_CloseMenuTimer));
}
}
}
return Plugin_Handled;
}
public Action Event_RoundStart(Handle event, const char[] name, bool dontBroadcast)
{
for(int i = 1; i <= MaxClients; i++)
{
g_CmdCount[i] = 0;
}
}
/*
public Action Event_PlayerTeam(Handle event, const char[] name, bool dontBroadcast)
{
if(GetConVarInt(g_enabled) == 1)
{
if( GetConVarBool(g_autodisplay) )
{
int client = GetClientOfUserId(GetEventInt(event, "userid"));
int team = GetEventInt(event, "team");
public Action Event_PlayerSpawn(Handle event, const char[] name, bool dontBroadcast)
{
if(GetConVarInt(g_enabled) == 1)
{
// Get the userid and client
int client = GetClientOfUserId(GetEventInt(event, "userid"));
if (StrEqual(Game, "csgo") && GetConVarInt(g_arms_enabled) == 1)
{
SetDefaultModels(client);
// Get the user's authid
KvJumpToKey(playermodelskva,authid[client],true);
char arms[256];
char groups[30];
// Get the user's model pref
if (!IsFakeClient(client) && IsValidClient(client) && GetClientTeam(client) == 2)
{
KvGetString(playermodelskva, "Team1", arms, sizeof(arms), "");
KvGetString(playermodelskva, "Team1Group", groups, sizeof(groups), "");
}
else if (!IsFakeClient(client) && IsValidClient(client) && GetClientTeam(client) == 3)
{
KvGetString(playermodelskva, "Team2", arms, sizeof(arms), "");
KvGetString(playermodelskva, "Team2Group", groups, sizeof(groups), "");
}
// Make sure that they have a valid model pref
if (!StrEqual(arms,"", false) && IsModelPrecached(arms))
{
// Set the Armsmodel
SetEntPropString(client, Prop_Send, "m_szArmsModel", arms);
}
if (!StrEqual(arms,"") && IsModelPrecached(arms))
{
SetEntPropString(client, Prop_Send, "m_szArmsModel", arms);
}
// Rewind the KVs
KvRewind(playermodelskva);
}
if (StrEqual(Game, "csgo") && GetConVarInt(g_arms_enabled) == 1)
{
if (!IsFakeClient(client) && IsValidClient(client))
{
CreateTimer(4.5, PlayerModel, client);
}
}
else
{
if (!IsFakeClient(client) && IsValidClient(client))
{
CreateTimer(3.5, Timer_Spawn, client);
}
}
public Action PlayerModel(Handle timer ,any client)
{
// Get the user's authid
KvJumpToKey(playermodelskv,authid[client],true);
char model[256];
char group[30];
// Get the user's model pref
if (!IsFakeClient(client) && IsValidClient(client) && GetClientTeam(client) == 2)
{
KvGetString(playermodelskv, "Team1", model, sizeof(model), "");
KvGetString(playermodelskv, "Team1Group", group, sizeof(group), "");
}
else if (!IsFakeClient(client) && IsValidClient(client) && GetClientTeam(client) == 3)
{
KvGetString(playermodelskv, "Team2", model, sizeof(model), "");
KvGetString(playermodelskv, "Team2Group", group, sizeof(group), "");
}
// Make sure that they have a valid model pref
if (!StrEqual(model,"", false) && IsModelPrecached(model))
{
// Set the model
SetEntityModel(client, model);
}
if (!StrEqual(model,"") && IsModelPrecached(model))
{
SetEntityModel(client, model);
}
// Rewind the KVs
KvRewind(playermodelskv);
}
public Action Timer_Spawn(Handle timer, any client)
{
// Get the user's authid
KvJumpToKey(playermodelskv,authid[client],true);
// Make sure that they have a valid model pref
if (!StrEqual(model,"", false) && IsModelPrecached(model))
{
// Set the model
SetEntityModel(client, model);
}
if (!StrEqual(model,"") && IsModelPrecached(model))
{
SetEntityModel(client, model);
}
// Rewind the KVs
KvRewind(playermodelskv);
}
stock bool IsValidClient(int client)
{
if (client <= 0) return false;
if (client > MaxClients) return false;
if (!IsClientConnected(client)) return false;
return IsClientInGame(client);
}
void skin_bots(int client)
{
int team = GetClientTeam(client);
if (team==2)
{
SetEntityModel(client,g_ModelsBotsTeam2[GetRandomInt(0, g_ModelsBots_Count_Team2-1)]);
}
else if (team==3)
{
SetEntityModel(client,g_ModelsBotsTeam3[GetRandomInt(0, g_ModelsBots_Count_Team3-1)]);
}
}
public Action skin_players(Handle timer, any client)
{
int team = GetClientTeam(client);
if (team==2)
{
SetEntityModel(client,g_ModelsPlayerTeam2[GetRandomInt(0, g_ModelsPlayer_Count_Team2-1)]);
}
else if (team==3)
{
SetEntityModel(client,g_ModelsPlayerTeam3[GetRandomInt(0, g_ModelsPlayer_Count_Team3-1)]);
}
}
public Action skin_admin(Handle timer, any client)
{
int team = GetClientTeam(client);
if (team==2)
{
SetEntityModel(client,g_ModelsAdminTeam2[GetRandomInt(0, g_ModelsAdmin_Count_Team2-1)]);
}
else if (team==3)
{
SetEntityModel(client,g_ModelsAdminTeam3[GetRandomInt(0, g_ModelsAdmin_Count_Team3-1)]);
}
}
stock void SetDefaultModels(int client)
{
if (IsValidClient(client) && IsPlayerAlive(client) && !IsFakeClient(client))
{
int team = GetClientTeam(client);
Hy i put skinchoser on a jailbreak server with forceskins but some round the skins don`t work i see only hand . and i chose !models it`s work , but skins force don`t work some round ?