entWatch4: improve last commit
This commit is contained in:
		
							parent
							
								
									aeacb71f43
								
							
						
					
					
						commit
						321f772098
					
				@ -10,6 +10,7 @@
 | 
				
			|||||||
#pragma newdecls required
 | 
					#pragma newdecls required
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <sourcemod>
 | 
					#include <sourcemod>
 | 
				
			||||||
 | 
					#include <cstrike>
 | 
				
			||||||
#include <entWatch_core>
 | 
					#include <entWatch_core>
 | 
				
			||||||
#include <entWatch_helpers>
 | 
					#include <entWatch_helpers>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -59,11 +60,7 @@ public void EW_OnClientItemDrop(int client, int index)
 | 
				
			|||||||
		item.dConfig.GetColor(sItemColor, sizeof(sItemColor));
 | 
							item.dConfig.GetColor(sItemColor, sizeof(sItemColor));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		CRemoveTags(sClientName, sizeof(sClientName));
 | 
							CRemoveTags(sClientName, sizeof(sClientName));
 | 
				
			||||||
		for(int i = 1; i <= MaxClients; i++)
 | 
							CPrintToTeamAndAdmins(iTeam, MESSAGEFORMAT, "E01B5D", "EDEDED", sClientName, "E562BA", "B2B2B2", sClientAuth, "E562BA", "Item Drop", sItemColor, sItemName);
 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			if(CheckIfTeamOrAdmin(iTeam, i))
 | 
					 | 
				
			||||||
				CPrintToChat(i, MESSAGEFORMAT, "E01B5D", "EDEDED", sClientName, "E562BA", "B2B2B2", sClientAuth, "E562BA", "Item Drop", sItemColor, sItemName);
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -92,11 +89,7 @@ public void EW_OnClientItemDeath(int client, int index)
 | 
				
			|||||||
		item.dConfig.GetColor(sItemColor, sizeof(sItemColor));
 | 
							item.dConfig.GetColor(sItemColor, sizeof(sItemColor));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		CRemoveTags(sClientName, sizeof(sClientName));
 | 
							CRemoveTags(sClientName, sizeof(sClientName));
 | 
				
			||||||
		for(int i = 1; i <= MaxClients; i++)
 | 
							CPrintToTeamAndAdmins(iTeam, MESSAGEFORMAT, "E01B5D", "EDEDED", sClientName, "F1B567", "B2B2B2", sClientAuth, "F1B567", "Item Death", sItemColor, sItemName);
 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			if(CheckIfTeamOrAdmin(iTeam, i))
 | 
					 | 
				
			||||||
				CPrintToChat(i, MESSAGEFORMAT, "E01B5D", "EDEDED", sClientName, "F1B567", "B2B2B2", sClientAuth, "F1B567", "Item Death", sItemColor, sItemName);
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -125,11 +118,7 @@ public void EW_OnClientItemPickup(int client, int index)
 | 
				
			|||||||
		item.dConfig.GetColor(sItemColor, sizeof(sItemColor));
 | 
							item.dConfig.GetColor(sItemColor, sizeof(sItemColor));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		CRemoveTags(sClientName, sizeof(sClientName));
 | 
							CRemoveTags(sClientName, sizeof(sClientName));
 | 
				
			||||||
		for(int i = 1; i <= MaxClients; i++)
 | 
							CPrintToTeamAndAdmins(iTeam, MESSAGEFORMAT, "E01B5D", "EDEDED", sClientName, "C9EF66", "B2B2B2", sClientAuth, "C9EF66", "Item Pickup", sItemColor, sItemName);
 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			if(CheckIfTeamOrAdmin(iTeam, i))
 | 
					 | 
				
			||||||
				CPrintToChat(i, MESSAGEFORMAT, "E01B5D", "EDEDED", sClientName, "C9EF66", "B2B2B2", sClientAuth, "C9EF66", "Item Pickup", sItemColor, sItemName);
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -158,11 +147,7 @@ public void EW_OnClientItemDisconnect(int client, int index)
 | 
				
			|||||||
		item.dConfig.GetColor(sItemColor, sizeof(sItemColor));
 | 
							item.dConfig.GetColor(sItemColor, sizeof(sItemColor));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		CRemoveTags(sClientName, sizeof(sClientName));
 | 
							CRemoveTags(sClientName, sizeof(sClientName));
 | 
				
			||||||
		for(int i = 1; i <= MaxClients; i++)
 | 
							CPrintToTeamAndAdmins(iTeam, MESSAGEFORMAT, "E01B5D", "EDEDED", sClientName, "67ADDF", "B2B2B2", sClientAuth, "67ADDF", "Item Activate", sItemColor, sItemName);
 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			if(CheckIfTeamOrAdmin(iTeam, i))
 | 
					 | 
				
			||||||
				CPrintToChat(i, MESSAGEFORMAT, "E01B5D", "EDEDED", sClientName, "67ADDF", "B2B2B2", sClientAuth, "67ADDF", "Item Activate", sItemColor, sItemName);
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -191,21 +176,24 @@ public void EW_OnClientItemActivate(int client, int index)
 | 
				
			|||||||
		item.dConfig.GetColor(sItemColor, sizeof(sItemColor));
 | 
							item.dConfig.GetColor(sItemColor, sizeof(sItemColor));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		CRemoveTags(sClientName, sizeof(sClientName));
 | 
							CRemoveTags(sClientName, sizeof(sClientName));
 | 
				
			||||||
		for(int i = 1; i <= MaxClients; i++)
 | 
							CPrintToTeamAndAdmins(iTeam, MESSAGEFORMAT, "E01B5D", "EDEDED", sClientName, "E562BA", "B2B2B2", sClientAuth, "E562BA", "Item Activate", sItemColor, sItemName);
 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			if(CheckIfTeamOrAdmin(iTeam, i))
 | 
					 | 
				
			||||||
				CPrintToChat(i, MESSAGEFORMAT, "E01B5D", "EDEDED", sClientName, "E562BA", "B2B2B2", sClientAuth, "E562BA", "Item Activate", sItemColor, sItemName);
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//----------------------------------------------------------------------------------------------------
 | 
					//----------------------------------------------------------------------------------------------------
 | 
				
			||||||
// Purpose:
 | 
					// Purpose:
 | 
				
			||||||
//----------------------------------------------------------------------------------------------------
 | 
					//----------------------------------------------------------------------------------------------------
 | 
				
			||||||
public bool CheckIfTeamOrAdmin(int team, int client)
 | 
					stock void CPrintToTeamAndAdmins(int team, const char[] format, any ...)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	if(client > 0 && client <= MaxClients && IsClientInGame(client) && (team == GetClientTeam(client) || team <= 1 || CheckCommandAccess(client, "", ADMFLAG_GENERIC)))
 | 
						char message[255];
 | 
				
			||||||
		return true;
 | 
						VFormat(message, sizeof(message), format, 3);
 | 
				
			||||||
	else
 | 
					
 | 
				
			||||||
		return false;
 | 
						for(int client = 1; client <= MaxClients; client++)
 | 
				
			||||||
}
 | 
						{
 | 
				
			||||||
 | 
							if(!IsClientInGame(client))
 | 
				
			||||||
 | 
								continue;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if(team <= CS_TEAM_SPECTATOR || team == GetClientTeam(client) || CheckCommandAccess(client, "", ADMFLAG_GENERIC))
 | 
				
			||||||
 | 
								CPrintToChat(client, "%s", message);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user