Skip to content

Commit

Permalink
v1.1
Browse files Browse the repository at this point in the history
Разделение скинов на Т и КТ команду
  • Loading branch information
Tetragromaton committed Nov 19, 2019
1 parent 55283f0 commit 7a5e2fb
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 6 deletions.
Binary file modified plugins/sskins.smx
Binary file not shown.
53 changes: 47 additions & 6 deletions scripting/sskins.sp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#define DEBUG

#define PLUGIN_AUTHOR "Tetragromaton"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_VERSION "1.1"

#include <sourcemod>
#include <sdktools>
Expand All @@ -22,7 +22,8 @@ public Plugin myinfo =
version = PLUGIN_VERSION,
url = "tetradev.org"
};
Handle g_sDataSkin;
Handle g_sDataSkin;//Terrorist
Handle g_sDataSKIN_CT;//CTF
public void OnPluginStart()
{
g_Game = GetEngineVersion();
Expand All @@ -32,7 +33,8 @@ public void OnPluginStart()
}
RegConsoleCmd("ssf", SpecialSkin3);
HookEvent("player_spawn", OnPlayerSpawn);
g_sDataSkin = RegClientCookie("ss_skin", "", CookieAccess_Private);
g_sDataSkin = RegClientCookie("ss_skin_t", "", CookieAccess_Private);
g_sDataSKIN_CT = RegClientCookie("ss_skin_ct", "", CookieAccess_Private);
}
public IsValidClient(client)
{
Expand All @@ -56,10 +58,16 @@ public Action ApplySkin(Handle timer, any:client)
{
char SkinNISMO[255];
GetClientCookie(client, g_sDataSkin, SkinNISMO, sizeof(SkinNISMO));
if(!StrEqual(SkinNISMO, ""))
char SkinNISMOXTUNE[255];
GetClientCookie(client, g_sDataSKIN_CT, SkinNISMOXTUNE, sizeof(SkinNISMOXTUNE));
if(GetClientTeam(client) == CS_TEAM_CT && !StrEqual(SkinNISMO, ""))
{
if (!IsModelPrecached(SkinNISMO))PrecacheModel(SkinNISMO);
Entity_SetModel(client, SkinNISMO);
}else if (GetClientTeam(client) == CS_TEAM_T && !StrEqual(SkinNISMOXTUNE, ""))
{
if (!IsModelPrecached(SkinNISMOXTUNE))PrecacheModel(SkinNISMOXTUNE);
Entity_SetModel(client, SkinNISMOXTUNE);
}
}
public Action SpecialSkin3(client,args)
Expand Down Expand Up @@ -102,6 +110,8 @@ public AgencySELECTOR(Handle:menu, MenuAction:action, param1, param2)
}else if(StrEqual(item, "Reset"))
{
SetClientCookie(param1, g_sDataSkin, "");
SetClientCookie(param1, g_sDataSKIN_CT, "");
PrintToChat(param1, "Параметры скинов были сброшены.");
}
}

Expand Down Expand Up @@ -177,100 +187,131 @@ public XCGSelector(Handle:menu, MenuAction:action, param1, param2)
char ModelName[255];
if(SPICK > 0)
{
int team = 0;
switch(SPICK)
{
case 6:
{
team = 2;
ModelName = "models/player/custom_player/legacy/tm_phoenix_varianth.mdl";
}
case 12:
{
team = 2;
ModelName = "models/player/custom_player/legacy/tm_phoenix_variantg.mdl";
}
case 5:
{
team = 2;
ModelName = "models/player/custom_player/legacy/tm_phoenix_variantf.mdl";
}
case 17:
{
team = 2;
ModelName = "models/player/custom_player/legacy/tm_leet_varianti.mdl";
}
case 4:
{
team = 2;
ModelName = "models/player/custom_player/legacy/tm_leet_variantg.mdl";
}
case 11:
{
team = 2;
ModelName = "models/player/custom_player/legacy/tm_leet_varianth.mdl";
}
case 14:
{
team = 2;
ModelName = "models/player/custom_player/legacy/tm_balkan_variantj.mdl";
}
case 9:
{
team = 2;
ModelName = "models/player/custom_player/legacy/tm_balkan_varianti.mdl";
}
case 21:
{
team = 2;
ModelName = "models/player/custom_player/legacy/tm_balkan_varianth.mdl";
}
case 18:
{
team = 2;
ModelName = "models/player/custom_player/legacy/tm_balkan_variantg.mdl";
}
case 13:
{
team = 2;
ModelName = "models/player/custom_player/legacy/tm_balkan_variantf.mdl";
}
case 16:
{
team = 1;
ModelName = "models/player/custom_player/legacy/ctm_st6_variantm.mdl";
}
case 19:
{
team = 1;
ModelName = "models/player/custom_player/legacy/ctm_st6_varianti.mdl";
}
case 10:
{
team = 1;
ModelName = "models/player/custom_player/legacy/ctm_st6_variantg.mdl";
}
case 7:
{
team = 1;
ModelName = "models/player/custom_player/legacy/ctm_sas_variantf.mdl";
}
case 15:
{
team = 1;
ModelName = "models/player/custom_player/legacy/ctm_fbi_varianth.mdl";
}
case 8:
{
team = 1;
ModelName = "models/player/custom_player/legacy/ctm_fbi_variantg.mdl";
}
case 20:
{
team = 1;
ModelName = "models/player/custom_player/legacy/ctm_fbi_variantb.mdl";
}
case 22:
{
team = 2;//T
ModelName = "models/player/custom_player/legacy/tm_leet_variantf.mdl";
}
case 3:
{
team = 1;
ModelName = "models/player/custom_player/legacy/ctm_fbi_variantf.mdl";
}
case 1:
{
team = 1;//CT
ModelName = "models/player/custom_player/legacy/ctm_st6_variante.mdl";
}
case 2:
{
team = 1;
ModelName = "models/player/custom_player/legacy/ctm_st6_variantk.mdl";
}
}
//PrintToChatAll("%s", ModelName);
SetClientCookie(param1, g_sDataSkin, ModelName);
PrintToChat(param1, "Модель агента будет установлена при следующем спавне.");

if(team == 1)
{
SetClientCookie(param1, g_sDataSkin, ModelName);
PrintToChat(param1, "Модель агента за КТ будет установлена при следующем спавне.");
}else if(team == 2)
{
PrintToChat(param1, "Модель агента за Т будет установлена при следующем спавне.");
SetClientCookie(param1, g_sDataSKIN_CT, ModelName);
}
}
}

Expand Down

0 comments on commit 7a5e2fb

Please sign in to comment.