Hitmarker: support for different skins + overall improvements
This commit is contained in:
		
							parent
							
								
									0097f066f8
								
							
						
					
					
						commit
						624138e551
					
				
							
								
								
									
										13
									
								
								Hitmarker/configs/Hitmarkers.cfg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								Hitmarker/configs/Hitmarkers.cfg
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,13 @@
 | 
				
			|||||||
 | 
					"Hitmarkers"
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						"0" // default one
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							"Path"		"unloze/hitmarker/hitmarker_nano"
 | 
				
			||||||
 | 
							"Name"		"Skin 1"
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						"1"
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							"Path"		"unloze/hitmarker/hitmarker_guc"
 | 
				
			||||||
 | 
							"Name"		"Skin 2"
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,7 @@
 | 
				
			|||||||
 | 
					"MonitorScreen"
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						"$basetexture" "unloze/hitmarker/hitmarker_guc"
 | 
				
			||||||
 | 
						"$alphatest" 1
 | 
				
			||||||
 | 
						"$translucent" 1
 | 
				
			||||||
 | 
						"$vertexalpha" 1
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										
											BIN
										
									
								
								Hitmarker/content/materials/unloze/hitmarker/hitmarker_guc.vtf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Hitmarker/content/materials/unloze/hitmarker/hitmarker_guc.vtf
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							@ -0,0 +1,5 @@
 | 
				
			|||||||
 | 
					"UnlitGeneric"
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						"$basetexture" "unloze/hitmarker/hitmarker_nano"
 | 
				
			||||||
 | 
						"$translucent" 1
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -1,5 +0,0 @@
 | 
				
			|||||||
"UnlitGeneric"
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	"$basetexture" "overlays/nano/hitmarker"
 | 
					 | 
				
			||||||
	"$translucent" 1
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@ -18,6 +18,11 @@ bool g_bShowZombieHitmarker[MAXPLAYERS+1];
 | 
				
			|||||||
bool g_bHitmarkerSound[MAXPLAYERS+1];
 | 
					bool g_bHitmarkerSound[MAXPLAYERS+1];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int g_iHitmarkerSoundVolume[MAXPLAYERS+1] = {100,...};
 | 
					int g_iHitmarkerSoundVolume[MAXPLAYERS+1] = {100,...};
 | 
				
			||||||
 | 
					int g_iHitmarkerSkin[MAXPLAYERS+1];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define MAXIMUMSKINS 6
 | 
				
			||||||
 | 
					char g_sHitmarkerSkins[MAXIMUMSKINS][PLATFORM_MAX_PATH];
 | 
				
			||||||
 | 
					char g_sHitmarkerSkinsNames[MAXIMUMSKINS][PLATFORM_MAX_PATH];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Handle g_hTimer[MAXPLAYERS+1] = {null,...};
 | 
					Handle g_hTimer[MAXPLAYERS+1] = {null,...};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -25,18 +30,17 @@ Handle g_hCookie_ShowBossHitmarker;
 | 
				
			|||||||
Handle g_hCookie_ShowZombieHitmarker;
 | 
					Handle g_hCookie_ShowZombieHitmarker;
 | 
				
			||||||
Handle g_hCookie_HitmarkerSound;
 | 
					Handle g_hCookie_HitmarkerSound;
 | 
				
			||||||
Handle g_hCookie_HitmarkerSoundVolume;
 | 
					Handle g_hCookie_HitmarkerSoundVolume;
 | 
				
			||||||
 | 
					Handle g_hCookie_HitmarkerSkin;
 | 
				
			||||||
//Handle g_hHudText;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
//----------------------------------------------------------------------------------------------------
 | 
					//----------------------------------------------------------------------------------------------------
 | 
				
			||||||
// Purpose:
 | 
					// Purpose:
 | 
				
			||||||
//----------------------------------------------------------------------------------------------------
 | 
					//----------------------------------------------------------------------------------------------------
 | 
				
			||||||
public Plugin myinfo =
 | 
					public Plugin myinfo =
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	name         = "Htimarker",
 | 
						name         = "Hitmarker",
 | 
				
			||||||
	author       = "Neon & Nano",
 | 
						author       = "Neon & Nano",
 | 
				
			||||||
	description  = "Players can enable or disable their hitmarkers while shooting zombies or bosses",
 | 
						description  = "Players can enable or disable their hitmarkers while shooting zombies or bosses",
 | 
				
			||||||
	version      = "1.0.0",
 | 
						version      = "2.0.0",
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//----------------------------------------------------------------------------------------------------
 | 
					//----------------------------------------------------------------------------------------------------
 | 
				
			||||||
@ -48,8 +52,7 @@ public void OnPluginStart()
 | 
				
			|||||||
	g_hCookie_ShowZombieHitmarker = RegClientCookie("hitmarker_zombie", "", CookieAccess_Private);
 | 
						g_hCookie_ShowZombieHitmarker = RegClientCookie("hitmarker_zombie", "", CookieAccess_Private);
 | 
				
			||||||
	g_hCookie_HitmarkerSound = RegClientCookie("hitmarker_sound", "", CookieAccess_Private);
 | 
						g_hCookie_HitmarkerSound = RegClientCookie("hitmarker_sound", "", CookieAccess_Private);
 | 
				
			||||||
	g_hCookie_HitmarkerSoundVolume = RegClientCookie("hitmarker_sound_volume", "", CookieAccess_Private);
 | 
						g_hCookie_HitmarkerSoundVolume = RegClientCookie("hitmarker_sound_volume", "", CookieAccess_Private);
 | 
				
			||||||
 | 
						g_hCookie_HitmarkerSkin = RegClientCookie("hitmarker_skin", "", CookieAccess_Private);
 | 
				
			||||||
	//g_hHudText = CreateHudSynchronizer();
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	RegConsoleCmd("sm_hm", OnHitmarkerSettings);
 | 
						RegConsoleCmd("sm_hm", OnHitmarkerSettings);
 | 
				
			||||||
	RegConsoleCmd("sm_hitmarker", OnHitmarkerSettings);
 | 
						RegConsoleCmd("sm_hitmarker", OnHitmarkerSettings);
 | 
				
			||||||
@ -59,7 +62,7 @@ public void OnPluginStart()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	SetCookieMenuItem(MenuHandler_CookieMenu, 0, "Hitmarker");
 | 
						SetCookieMenuItem(MenuHandler_CookieMenu, 0, "Hitmarker");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	HookEvent("player_hurt",  OnClientHurt);
 | 
						HookEvent("player_hurt", OnClientHurt);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//----------------------------------------------------------------------------------------------------
 | 
					//----------------------------------------------------------------------------------------------------
 | 
				
			||||||
@ -67,10 +70,66 @@ public void OnPluginStart()
 | 
				
			|||||||
//----------------------------------------------------------------------------------------------------
 | 
					//----------------------------------------------------------------------------------------------------
 | 
				
			||||||
public void OnMapStart()
 | 
					public void OnMapStart()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	PrecacheGeneric("overlays/nano/hitmarker.vtf", true);
 | 
						for (int i = 0; i < MAXIMUMSKINS; i++)
 | 
				
			||||||
	PrecacheGeneric("overlays/nano/hitmarker.vmt", true);
 | 
						{
 | 
				
			||||||
	AddFileToDownloadsTable("materials/overlays/nano/hitmarker.vtf");
 | 
							g_sHitmarkerSkins[i] = "";
 | 
				
			||||||
	AddFileToDownloadsTable("materials/overlays/nano/hitmarker.vmt");
 | 
							g_sHitmarkerSkinsNames[i] = "";
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						char sConfigFile[PLATFORM_MAX_PATH];
 | 
				
			||||||
 | 
						BuildPath(Path_SM, sConfigFile, sizeof(sConfigFile), "configs/Hitmarkers.cfg");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (!FileExists(sConfigFile))
 | 
				
			||||||
 | 
							SetFailState("Could not find: \"%s\"", sConfigFile);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						KeyValues Hitmarkers = new KeyValues("Hitmarkers");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (!Hitmarkers.ImportFromFile(sConfigFile))
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							delete Hitmarkers;
 | 
				
			||||||
 | 
							SetFailState("ImportFromFile() failed!");
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (!Hitmarkers.GotoFirstSubKey())
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							delete Hitmarkers;
 | 
				
			||||||
 | 
							SetFailState("Unable to goto first sub key in: \"%s\"", sConfigFile);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						int i = 0;
 | 
				
			||||||
 | 
						do
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							char sPath[PLATFORM_MAX_PATH];
 | 
				
			||||||
 | 
							Hitmarkers.GetString("Path", sPath, sizeof(sPath), "error");
 | 
				
			||||||
 | 
							if (StrEqual(sPath, "error"))
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								delete Hitmarkers;
 | 
				
			||||||
 | 
								SetFailState("Unable to read Path");
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							char sName[32];
 | 
				
			||||||
 | 
							Hitmarkers.GetString("Name", sName, sizeof(sName), "error");
 | 
				
			||||||
 | 
							if (StrEqual(sName, "error"))
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								delete Hitmarkers;
 | 
				
			||||||
 | 
								SetFailState("Unable to read Name");
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							char sBuffer[PLATFORM_MAX_PATH];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							Format(sBuffer, sizeof(sBuffer), "materials/%s.vmt", sPath);
 | 
				
			||||||
 | 
							PrecacheGeneric(sBuffer, true);
 | 
				
			||||||
 | 
							AddFileToDownloadsTable(sBuffer);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							Format(sBuffer, sizeof(sBuffer), "materials/%s.vtf", sPath);
 | 
				
			||||||
 | 
							PrecacheGeneric(sBuffer, true);
 | 
				
			||||||
 | 
							AddFileToDownloadsTable(sBuffer);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							g_sHitmarkerSkins[i] = sPath;
 | 
				
			||||||
 | 
							g_sHitmarkerSkinsNames[i] = sName;
 | 
				
			||||||
 | 
							i++;
 | 
				
			||||||
 | 
						} while(Hitmarkers.GotoNextKey());
 | 
				
			||||||
 | 
						delete Hitmarkers;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	PrecacheSound("unloze/hm_v3.mp3");
 | 
						PrecacheSound("unloze/hm_v3.mp3");
 | 
				
			||||||
	AddFileToDownloadsTable("sound/unloze/hm_v3.mp3");
 | 
						AddFileToDownloadsTable("sound/unloze/hm_v3.mp3");
 | 
				
			||||||
@ -81,34 +140,46 @@ public void OnMapStart()
 | 
				
			|||||||
//----------------------------------------------------------------------------------------------------
 | 
					//----------------------------------------------------------------------------------------------------
 | 
				
			||||||
public void OnClientCookiesCached(int client)
 | 
					public void OnClientCookiesCached(int client)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	char sBuffer[4];
 | 
						char sBuffer[PLATFORM_MAX_PATH];
 | 
				
			||||||
	GetClientCookie(client, g_hCookie_ShowBossHitmarker, sBuffer, sizeof(sBuffer));
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						GetClientCookie(client, g_hCookie_ShowBossHitmarker, sBuffer, sizeof(sBuffer));
 | 
				
			||||||
	if (sBuffer[0])
 | 
						if (sBuffer[0])
 | 
				
			||||||
		g_bShowBossHitmarker[client] = true;
 | 
							g_bShowBossHitmarker[client] = true;
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
		g_bShowBossHitmarker[client] = false;
 | 
							g_bShowBossHitmarker[client] = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	GetClientCookie(client, g_hCookie_ShowZombieHitmarker, sBuffer, sizeof(sBuffer));
 | 
						GetClientCookie(client, g_hCookie_ShowZombieHitmarker, sBuffer, sizeof(sBuffer));
 | 
				
			||||||
 | 
					 | 
				
			||||||
	if (sBuffer[0])
 | 
						if (sBuffer[0])
 | 
				
			||||||
		g_bShowZombieHitmarker[client] = true;
 | 
							g_bShowZombieHitmarker[client] = true;
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
		g_bShowZombieHitmarker[client] = false;
 | 
							g_bShowZombieHitmarker[client] = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	GetClientCookie(client, g_hCookie_HitmarkerSound, sBuffer, sizeof(sBuffer));
 | 
						GetClientCookie(client, g_hCookie_HitmarkerSound, sBuffer, sizeof(sBuffer));
 | 
				
			||||||
 | 
					 | 
				
			||||||
	if (sBuffer[0])
 | 
						if (sBuffer[0])
 | 
				
			||||||
		g_bHitmarkerSound[client] = true;
 | 
							g_bHitmarkerSound[client] = true;
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
		g_bHitmarkerSound[client] = false;
 | 
							g_bHitmarkerSound[client] = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	GetClientCookie(client, g_hCookie_HitmarkerSoundVolume, sBuffer, sizeof(sBuffer));
 | 
						GetClientCookie(client, g_hCookie_HitmarkerSoundVolume, sBuffer, sizeof(sBuffer));
 | 
				
			||||||
 | 
					 | 
				
			||||||
	if (sBuffer[0])
 | 
						if (sBuffer[0])
 | 
				
			||||||
		g_iHitmarkerSoundVolume[client] = StringToInt(sBuffer);
 | 
							g_iHitmarkerSoundVolume[client] = StringToInt(sBuffer);
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
		g_iHitmarkerSoundVolume[client] = 100;
 | 
							g_iHitmarkerSoundVolume[client] = 100;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						GetClientCookie(client, g_hCookie_HitmarkerSkin, sBuffer, sizeof(sBuffer));
 | 
				
			||||||
 | 
						if (sBuffer[0])
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							for (int i = 0; i < MAXIMUMSKINS; i++)
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								if (StrEqual(g_sHitmarkerSkins[i], sBuffer))
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									g_iHitmarkerSkin[client] = i;
 | 
				
			||||||
 | 
									break;
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						else
 | 
				
			||||||
 | 
							g_iHitmarkerSkin[client] = 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//----------------------------------------------------------------------------------------------------
 | 
					//----------------------------------------------------------------------------------------------------
 | 
				
			||||||
@ -120,6 +191,7 @@ public void OnClientDisconnect(int client)
 | 
				
			|||||||
	g_bShowZombieHitmarker[client] = false;
 | 
						g_bShowZombieHitmarker[client] = false;
 | 
				
			||||||
	g_bHitmarkerSound[client] = false;
 | 
						g_bHitmarkerSound[client] = false;
 | 
				
			||||||
	g_iHitmarkerSoundVolume[client] = 100;
 | 
						g_iHitmarkerSoundVolume[client] = 100;
 | 
				
			||||||
 | 
						g_iHitmarkerSkin[client] = 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//----------------------------------------------------------------------------------------------------
 | 
					//----------------------------------------------------------------------------------------------------
 | 
				
			||||||
@ -149,6 +221,9 @@ public void ToggleBossHitmarker(int client)
 | 
				
			|||||||
	SetClientCookie(client, g_hCookie_ShowBossHitmarker, g_bShowBossHitmarker[client] ? "1" : "");
 | 
						SetClientCookie(client, g_hCookie_ShowBossHitmarker, g_bShowBossHitmarker[client] ? "1" : "");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	CPrintToChat(client, "{cyan}[Hitmarker] {white}%s.", g_bShowBossHitmarker[client] ? "Boss Hitmarker Enabled" : "Boss Hitmarker Disabled");
 | 
						CPrintToChat(client, "{cyan}[Hitmarker] {white}%s.", g_bShowBossHitmarker[client] ? "Boss Hitmarker Enabled" : "Boss Hitmarker Disabled");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (g_bShowBossHitmarker[client])
 | 
				
			||||||
 | 
							ShowOverlay(client, 2.0);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//----------------------------------------------------------------------------------------------------
 | 
					//----------------------------------------------------------------------------------------------------
 | 
				
			||||||
@ -169,6 +244,9 @@ public void ToggleZombieHitmarker(int client)
 | 
				
			|||||||
	SetClientCookie(client, g_hCookie_ShowZombieHitmarker, g_bShowZombieHitmarker[client] ? "1" : "");
 | 
						SetClientCookie(client, g_hCookie_ShowZombieHitmarker, g_bShowZombieHitmarker[client] ? "1" : "");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	CPrintToChat(client, "{cyan}[Hitmarker] {white}%s.", g_bShowZombieHitmarker[client] ? "Zombie Hitmarker Enabled" : "Zombie Hitmarker Disabled");
 | 
						CPrintToChat(client, "{cyan}[Hitmarker] {white}%s.", g_bShowZombieHitmarker[client] ? "Zombie Hitmarker Enabled" : "Zombie Hitmarker Disabled");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (g_bShowZombieHitmarker[client])
 | 
				
			||||||
 | 
							ShowOverlay(client, 2.0);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//----------------------------------------------------------------------------------------------------
 | 
					//----------------------------------------------------------------------------------------------------
 | 
				
			||||||
@ -189,6 +267,9 @@ public void ToggleHitmarkerSound(int client)
 | 
				
			|||||||
	SetClientCookie(client, g_hCookie_HitmarkerSound, g_bHitmarkerSound[client] ? "1" : "");
 | 
						SetClientCookie(client, g_hCookie_HitmarkerSound, g_bHitmarkerSound[client] ? "1" : "");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	CPrintToChat(client, "{cyan}[Hitmarker] {white}%s.", g_bHitmarkerSound[client] ? "Hitmarker Sound Enabled" : "Hitmarker Sound Disabled");
 | 
						CPrintToChat(client, "{cyan}[Hitmarker] {white}%s.", g_bHitmarkerSound[client] ? "Hitmarker Sound Enabled" : "Hitmarker Sound Disabled");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (g_bHitmarkerSound[client])
 | 
				
			||||||
 | 
							ShowOverlay(client, 2.0);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//----------------------------------------------------------------------------------------------------
 | 
					//----------------------------------------------------------------------------------------------------
 | 
				
			||||||
@ -206,7 +287,22 @@ public void ToggleHitmarkerSoundVolume(int client)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	SetClientCookie(client, g_hCookie_HitmarkerSoundVolume, sBuffer);
 | 
						SetClientCookie(client, g_hCookie_HitmarkerSoundVolume, sBuffer);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	//CPrintToChat(client, "{cyan}[Hitmarker] {white}Hitmarker Sound Volume: %d\%", g_iHitmarkerSoundVolume[client]);
 | 
						ShowOverlay(client, 2.0);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//----------------------------------------------------------------------------------------------------
 | 
				
			||||||
 | 
					// Purpose:
 | 
				
			||||||
 | 
					//----------------------------------------------------------------------------------------------------
 | 
				
			||||||
 | 
					public void ToggleHitmarkerSkin(int client)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						g_iHitmarkerSkin[client]++;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (StrEqual(g_sHitmarkerSkins[g_iHitmarkerSkin[client]], ""))
 | 
				
			||||||
 | 
							g_iHitmarkerSkin[client] = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						SetClientCookie(client, g_hCookie_HitmarkerSkin, g_sHitmarkerSkins[g_iHitmarkerSkin[client]]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						ShowOverlay(client, 2.0);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//----------------------------------------------------------------------------------------------------
 | 
					//----------------------------------------------------------------------------------------------------
 | 
				
			||||||
@ -232,6 +328,9 @@ public void ShowSettingsMenu(int client)
 | 
				
			|||||||
	Format(sBuffer, sizeof(sBuffer), "Hitmarker Sound Volume: %d\%", g_iHitmarkerSoundVolume[client]);
 | 
						Format(sBuffer, sizeof(sBuffer), "Hitmarker Sound Volume: %d\%", g_iHitmarkerSoundVolume[client]);
 | 
				
			||||||
	menu.AddItem("3", sBuffer);
 | 
						menu.AddItem("3", sBuffer);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						Format(sBuffer, sizeof(sBuffer), "Hitmarker Skin: %s", g_sHitmarkerSkinsNames[g_iHitmarkerSkin[client]]);
 | 
				
			||||||
 | 
						menu.AddItem("4", sBuffer);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	menu.ExitBackButton = true;
 | 
						menu.ExitBackButton = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	menu.Display(client, MENU_TIME_FOREVER);
 | 
						menu.Display(client, MENU_TIME_FOREVER);
 | 
				
			||||||
@ -270,6 +369,7 @@ public int MenuHandler_MainMenu(Menu menu, MenuAction action, int client, int se
 | 
				
			|||||||
				case(1): ToggleZombieHitmarker(client);
 | 
									case(1): ToggleZombieHitmarker(client);
 | 
				
			||||||
				case(2): ToggleHitmarkerSound(client);
 | 
									case(2): ToggleHitmarkerSound(client);
 | 
				
			||||||
				case(3): ToggleHitmarkerSoundVolume(client);
 | 
									case(3): ToggleHitmarkerSoundVolume(client);
 | 
				
			||||||
 | 
									case(4): ToggleHitmarkerSkin(client);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			ShowSettingsMenu(client);
 | 
								ShowSettingsMenu(client);
 | 
				
			||||||
@ -294,11 +394,7 @@ public void OnBossDamaged(CBoss Boss, CConfig Config, int client, float damage)
 | 
				
			|||||||
		return;
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (g_bShowBossHitmarker[client])
 | 
						if (g_bShowBossHitmarker[client])
 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		//SetHudTextParams(-1.0, -1.0, 0.3, 255, 0, 0, 255, 0, 0.0, 0.0, 0.0);
 | 
					 | 
				
			||||||
		//ShowSyncHudText(client, g_hHudText, "∷");
 | 
					 | 
				
			||||||
		ShowOverlay(client);
 | 
							ShowOverlay(client);
 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for (int spec = 1; spec <= MaxClients; spec++)
 | 
						for (int spec = 1; spec <= MaxClients; spec++)
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
@ -309,11 +405,7 @@ public void OnBossDamaged(CBoss Boss, CConfig Config, int client, float damage)
 | 
				
			|||||||
		int specTarget = GetClientSpectatorTarget(spec);
 | 
							int specTarget = GetClientSpectatorTarget(spec);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if ((specMode == SPECMODE_FIRSTPERSON) && specTarget == client)
 | 
							if ((specMode == SPECMODE_FIRSTPERSON) && specTarget == client)
 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			//SetHudTextParams(-1.0, -1.0, 0.3, 255, 0, 0, 255, 0, 0.0, 0.0, 0.0);
 | 
					 | 
				
			||||||
			//ShowSyncHudText(spec, g_hHudText, "∷");
 | 
					 | 
				
			||||||
			ShowOverlay(spec);
 | 
								ShowOverlay(spec);
 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -332,11 +424,7 @@ public void OnClientHurt(Event hEvent, const char[] sEvent, bool bDontBroadcast)
 | 
				
			|||||||
		return;
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (g_bShowZombieHitmarker[client])
 | 
						if (g_bShowZombieHitmarker[client])
 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		//SetHudTextParams(-1.0, -1.0, 0.3, 255, 0, 0, 255, 0, 0.0, 0.0, 0.0);
 | 
					 | 
				
			||||||
		//ShowSyncHudText(client, g_hHudText, "∷");
 | 
					 | 
				
			||||||
		ShowOverlay(client);
 | 
							ShowOverlay(client);
 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for (int spec = 1; spec <= MaxClients; spec++)
 | 
						for (int spec = 1; spec <= MaxClients; spec++)
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
@ -347,19 +435,14 @@ public void OnClientHurt(Event hEvent, const char[] sEvent, bool bDontBroadcast)
 | 
				
			|||||||
		int specTarget = GetClientSpectatorTarget(spec);
 | 
							int specTarget = GetClientSpectatorTarget(spec);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (specMode == SPECMODE_FIRSTPERSON && specTarget == client)
 | 
							if (specMode == SPECMODE_FIRSTPERSON && specTarget == client)
 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			//SetHudTextParams(-1.0, -1.0, 0.3, 255, 0, 0, 255, 0, 0.0, 0.0, 0.0);
 | 
					 | 
				
			||||||
			//ShowSyncHudText(spec, g_hHudText, "∷");
 | 
					 | 
				
			||||||
			ShowOverlay(spec);
 | 
								ShowOverlay(spec);
 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//----------------------------------------------------------------------------------------------------
 | 
					//----------------------------------------------------------------------------------------------------
 | 
				
			||||||
// Purpose:
 | 
					// Purpose:
 | 
				
			||||||
//----------------------------------------------------------------------------------------------------
 | 
					//----------------------------------------------------------------------------------------------------
 | 
				
			||||||
public void ShowOverlay(int client)
 | 
					void ShowOverlay(int client, float fTime = 0.3)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	if (g_bHitmarkerSound[client])
 | 
						if (g_bHitmarkerSound[client])
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
@ -372,8 +455,8 @@ public void ShowOverlay(int client)
 | 
				
			|||||||
		delete g_hTimer[client];
 | 
							delete g_hTimer[client];
 | 
				
			||||||
		g_hTimer[client] = null;
 | 
							g_hTimer[client] = null;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	ClientCommand(client, "r_screenoverlay \"%s\"", "overlays/nano/hitmarker");
 | 
						ClientCommand(client, "r_screenoverlay \"%s\"", g_sHitmarkerSkins[g_iHitmarkerSkin[client]]);
 | 
				
			||||||
	g_hTimer[client] = CreateTimer(0.3, ClearOverlay, client, TIMER_FLAG_NO_MAPCHANGE);
 | 
						g_hTimer[client] = CreateTimer(fTime, ClearOverlay, client, TIMER_FLAG_NO_MAPCHANGE);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//----------------------------------------------------------------------------------------------------
 | 
					//----------------------------------------------------------------------------------------------------
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user