[Discord] Slight formatting and demo info.
This commit is contained in:
		
							parent
							
								
									4cf7f2c8c2
								
							
						
					
					
						commit
						265dfce9d7
					
				@ -595,11 +595,11 @@ public Action OnLogAction(Handle hSource, Identity ident, int client, int target
 | 
				
			|||||||
	GetCurrentMap(sCurrentMap, sizeof(sCurrentMap));
 | 
						GetCurrentMap(sCurrentMap, sizeof(sCurrentMap));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (IsDemoRecording())
 | 
						if (IsDemoRecording())
 | 
				
			||||||
		Format(sDemoInfo, sizeof(sDemoInfo), "[ Demo: %d @ Tick: %d ]", GetDemoRecordingNumber(), GetDemoRecordingTick());
 | 
							Format(sDemoInfo, sizeof(sDemoInfo), "Demo: %d @ Tick: %d", GetDemoRecordingNumber(), GetDemoRecordingTick());
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
		Format(sDemoInfo, sizeof(sDemoInfo), "[ Not recording ]");
 | 
							Format(sDemoInfo, sizeof(sDemoInfo), "Not recording");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	Format(sFinal, sizeof(sFinal), "[ %s ]%s```%s```", sCurrentMap, sDemoInfo, sMsg);
 | 
						Format(sFinal, sizeof(sFinal), "[ %s ][ %s ]```%s```", sCurrentMap, sDemoInfo, sMsg);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	GetClientName(client, sClientName, sizeof(sClientName));
 | 
						GetClientName(client, sClientName, sizeof(sClientName));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -769,7 +769,7 @@ public void CallAdmin_OnReportHandled(int client, int id)
 | 
				
			|||||||
		Discord_POST(DISCORD_CALLADMIN_WEBHOOKURL, sMessage, true, sUsername, false, "", false);
 | 
							Discord_POST(DISCORD_CALLADMIN_WEBHOOKURL, sMessage, true, sUsername, false, "", false);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
//'
 | 
					//'
 | 
				
			||||||
 | 
					/*
 | 
				
			||||||
public Action Oryx_OnTrigger(int client, int &level, char[] cheat)
 | 
					public Action Oryx_OnTrigger(int client, int &level, char[] cheat)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    char sUsername[MAX_NAME_LENGTH];
 | 
					    char sUsername[MAX_NAME_LENGTH];
 | 
				
			||||||
@ -790,18 +790,27 @@ public Action Oryx_OnTrigger(int client, int &level, char[] cheat)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    return Plugin_Continue;
 | 
					    return Plugin_Continue;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					*/
 | 
				
			||||||
public void AntiBhopCheat_OnClientDetected(int client, char[] sReason, char[] sStats)
 | 
					public void AntiBhopCheat_OnClientDetected(int client, char[] sReason, char[] sStats)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
						char sCurrentMap[64];
 | 
				
			||||||
 | 
						GetCurrentMap(sCurrentMap, sizeof(sCurrentMap));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						char sDemoInfo[64];
 | 
				
			||||||
 | 
						if (IsDemoRecording())
 | 
				
			||||||
 | 
							Format(sDemoInfo, sizeof(sDemoInfo), "Demo: %d @ Tick: %d", GetDemoRecordingNumber(), GetDemoRecordingTick());
 | 
				
			||||||
 | 
						else
 | 
				
			||||||
 | 
							Format(sDemoInfo, sizeof(sDemoInfo), "Not recording");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						char sTrimmedStats[1792]; // 128 x 14
 | 
				
			||||||
 | 
						strcopy(sTrimmedStats, sizeof(sTrimmedStats), sStats);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						char sMessage[1920]; // 128 x 15
 | 
				
			||||||
 | 
						Format(sMessage, sizeof(sMessage), "[ %s ][ %s ]```%s\n%s```", sCurrentMap, sDemoInfo, sReason, sTrimmedStats);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	char sUsername[MAX_NAME_LENGTH];
 | 
						char sUsername[MAX_NAME_LENGTH];
 | 
				
			||||||
	GetClientName(client, sUsername, sizeof(sUsername));
 | 
						GetClientName(client, sUsername, sizeof(sUsername));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	char currentMap[64];
 | 
					 | 
				
			||||||
	GetCurrentMap(currentMap, sizeof(currentMap));
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	char sMessage[1900];
 | 
					 | 
				
			||||||
	Format(sMessage, sizeof(sMessage), "```%s - Tick: %d``````%s\n%s```", currentMap, GetGameTickCount(), sReason, sStats);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if (g_sAvatarURL[client][0] != '\0')
 | 
						if (g_sAvatarURL[client][0] != '\0')
 | 
				
			||||||
		Discord_POST(DISCORD_ANTIBHOPCHEAT_WEBHOOKURL, sMessage, true, sUsername, true, g_sAvatarURL[client], false);
 | 
							Discord_POST(DISCORD_ANTIBHOPCHEAT_WEBHOOKURL, sMessage, true, sUsername, true, g_sAvatarURL[client], false);
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
@ -810,30 +819,28 @@ public void AntiBhopCheat_OnClientDetected(int client, char[] sReason, char[] sS
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
public void EW_OnClientRestricted(int client, int target, int length)
 | 
					public void EW_OnClientRestricted(int client, int target, int length)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	char sUsername[MAX_NAME_LENGTH];
 | 
						char sCurrentMap[64];
 | 
				
			||||||
	GetClientName(target, sUsername, sizeof(sUsername));
 | 
						GetCurrentMap(sCurrentMap, sizeof(sCurrentMap));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	char currentMap[64];
 | 
						char sDemoInfo[64];
 | 
				
			||||||
	GetCurrentMap(currentMap, sizeof(currentMap));
 | 
						if (IsDemoRecording())
 | 
				
			||||||
 | 
							Format(sDemoInfo, sizeof(sDemoInfo), "Demo: %d @ Tick: %d", GetDemoRecordingNumber(), GetDemoRecordingTick());
 | 
				
			||||||
	char sMessageTmp[1900];
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if (length == -1)
 | 
					 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		Format(sMessageTmp, sizeof(sMessageTmp), "%L got temporarily restricted by %L", target, client);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	else if (length == 0)
 | 
					 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		Format(sMessageTmp, sizeof(sMessageTmp), "%L got PERMANENTLY restricted by %L", target, client);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
	{
 | 
							Format(sDemoInfo, sizeof(sDemoInfo), "Not recording");
 | 
				
			||||||
		Format(sMessageTmp, sizeof(sMessageTmp), "%L got restricted by %L for %d minutes", target, client, length);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						char sMessageTemp[1280]; // 128 x 10
 | 
				
			||||||
 | 
						if (length == -1)
 | 
				
			||||||
 | 
							Format(sMessageTemp, sizeof(sMessageTemp), "%L got temporarily restricted by %L", target, client);
 | 
				
			||||||
 | 
						else if (length == 0)
 | 
				
			||||||
 | 
							Format(sMessageTemp, sizeof(sMessageTemp), "%L got permanently restricted by %L", target, client);
 | 
				
			||||||
 | 
						else
 | 
				
			||||||
 | 
							Format(sMessageTemp, sizeof(sMessageTemp), "%L got restricted by %L for %d minutes", target, client, length);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	char sMessage[1900];
 | 
						char sMessage[1920]; // 128 x 15
 | 
				
			||||||
	Format(sMessage, sizeof(sMessage), "```%s - Tick: %d``````%s```", currentMap, GetGameTickCount(), sMessageTmp);
 | 
						Format(sMessage, sizeof(sMessage), "[ %s ][ %s ]```%s```", sCurrentMap, sDemoInfo, sMessageTemp);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						char sUsername[MAX_NAME_LENGTH];
 | 
				
			||||||
 | 
						GetClientName(client, sUsername, sizeof(sUsername));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (g_sAvatarURL[target][0] != '\0')
 | 
						if (g_sAvatarURL[target][0] != '\0')
 | 
				
			||||||
		Discord_POST(DISCORD_ENTWATCH_WEBHOOKURL, sMessage, true, sUsername, true, g_sAvatarURL[target], false);
 | 
							Discord_POST(DISCORD_ENTWATCH_WEBHOOKURL, sMessage, true, sUsername, true, g_sAvatarURL[target], false);
 | 
				
			||||||
@ -844,17 +851,23 @@ public void EW_OnClientRestricted(int client, int target, int length)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
public void EW_OnClientUnrestricted(int client, int target)
 | 
					public void EW_OnClientUnrestricted(int client, int target)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
						char sCurrentMap[64];
 | 
				
			||||||
 | 
						GetCurrentMap(sCurrentMap, sizeof(sCurrentMap));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						char sDemoInfo[64];
 | 
				
			||||||
 | 
						if (IsDemoRecording())
 | 
				
			||||||
 | 
							Format(sDemoInfo, sizeof(sDemoInfo), "Demo: %d @ Tick: %d", GetDemoRecordingNumber(), GetDemoRecordingTick());
 | 
				
			||||||
 | 
						else
 | 
				
			||||||
 | 
							Format(sDemoInfo, sizeof(sDemoInfo), "Not recording");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						char sMessageTemp[1280]; // 128 x 10
 | 
				
			||||||
 | 
						Format(sMessageTemp, sizeof(sMessageTemp), "%L got unrestricted by %L", target, client);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						char sMessage[1920]; // 128 x 15
 | 
				
			||||||
 | 
						Format(sMessage, sizeof(sMessage), "[ %s ][ %s ]```%s```", sCurrentMap, sDemoInfo, sMessageTemp);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	char sUsername[MAX_NAME_LENGTH];
 | 
						char sUsername[MAX_NAME_LENGTH];
 | 
				
			||||||
	GetClientName(target, sUsername, sizeof(sUsername));
 | 
						GetClientName(client, sUsername, sizeof(sUsername));
 | 
				
			||||||
 | 
					 | 
				
			||||||
	char currentMap[64];
 | 
					 | 
				
			||||||
	GetCurrentMap(currentMap, sizeof(currentMap));
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	char sMessageTmp[1900];
 | 
					 | 
				
			||||||
	Format(sMessageTmp, sizeof(sMessageTmp), "%L got unrestricted by %L", target, client);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	char sMessage[1900];
 | 
					 | 
				
			||||||
	Format(sMessage, sizeof(sMessage), "```%s - Tick: %d``````%s```", currentMap, GetGameTickCount(), sMessageTmp);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (g_sAvatarURL[target][0] != '\0')
 | 
						if (g_sAvatarURL[target][0] != '\0')
 | 
				
			||||||
		Discord_POST(DISCORD_ENTWATCH_WEBHOOKURL, sMessage, true, sUsername, true, g_sAvatarURL[target], false);
 | 
							Discord_POST(DISCORD_ENTWATCH_WEBHOOKURL, sMessage, true, sUsername, true, g_sAvatarURL[target], false);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user