eW: team only messages
(admins still global)
This commit is contained in:
parent
77c0a799fa
commit
a1b24ac6ca
@ -40,6 +40,7 @@ public void OnPluginStart()
|
||||
public void EW_OnClientItemDrop(int client, int index)
|
||||
{
|
||||
CItem item = EW_GetItemData(index);
|
||||
int iTeam = GetClientTeam(client);
|
||||
|
||||
if (item.dConfig.bDisplayEventMessages)
|
||||
{
|
||||
@ -58,7 +59,11 @@ public void EW_OnClientItemDrop(int client, int index)
|
||||
item.dConfig.GetColor(sItemColor, sizeof(sItemColor));
|
||||
|
||||
CRemoveTags(sClientName, sizeof(sClientName));
|
||||
CPrintToChatAll(MESSAGEFORMAT, "E01B5D", "EDEDED", sClientName, "E562BA", "B2B2B2", sClientAuth, "E562BA", "Item Drop", sItemColor, sItemName);
|
||||
for(int i = 1; i <= MaxClients; i++)
|
||||
{
|
||||
if(CheckIfTeamOrAdmin(iTeam, i))
|
||||
CPrintToChat(i, MESSAGEFORMAT, "E01B5D", "EDEDED", sClientName, "E562BA", "B2B2B2", sClientAuth, "E562BA", "Item Drop", sItemColor, sItemName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -68,6 +73,7 @@ public void EW_OnClientItemDrop(int client, int index)
|
||||
public void EW_OnClientItemDeath(int client, int index)
|
||||
{
|
||||
CItem item = EW_GetItemData(index);
|
||||
int iTeam = GetClientTeam(client);
|
||||
|
||||
if (item.dConfig.bDisplayEventMessages)
|
||||
{
|
||||
@ -86,7 +92,11 @@ public void EW_OnClientItemDeath(int client, int index)
|
||||
item.dConfig.GetColor(sItemColor, sizeof(sItemColor));
|
||||
|
||||
CRemoveTags(sClientName, sizeof(sClientName));
|
||||
CPrintToChatAll(MESSAGEFORMAT, "E01B5D", "EDEDED", sClientName, "F1B567", "B2B2B2", sClientAuth, "F1B567", "Item Death", sItemColor, sItemName);
|
||||
for(int i = 1; i <= MaxClients; i++)
|
||||
{
|
||||
if(CheckIfTeamOrAdmin(iTeam, i))
|
||||
CPrintToChat(i, MESSAGEFORMAT, "E01B5D", "EDEDED", sClientName, "F1B567", "B2B2B2", sClientAuth, "F1B567", "Item Death", sItemColor, sItemName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -96,6 +106,7 @@ public void EW_OnClientItemDeath(int client, int index)
|
||||
public void EW_OnClientItemPickup(int client, int index)
|
||||
{
|
||||
CItem item = EW_GetItemData(index);
|
||||
int iTeam = GetClientTeam(client);
|
||||
|
||||
if (item.dConfig.bDisplayEventMessages)
|
||||
{
|
||||
@ -114,7 +125,11 @@ public void EW_OnClientItemPickup(int client, int index)
|
||||
item.dConfig.GetColor(sItemColor, sizeof(sItemColor));
|
||||
|
||||
CRemoveTags(sClientName, sizeof(sClientName));
|
||||
CPrintToChatAll(MESSAGEFORMAT, "E01B5D", "EDEDED", sClientName, "C9EF66", "B2B2B2", sClientAuth, "C9EF66", "Item Pickup", sItemColor, sItemName);
|
||||
for(int i = 1; i <= MaxClients; i++)
|
||||
{
|
||||
if(CheckIfTeamOrAdmin(iTeam, i))
|
||||
CPrintToChat(i, MESSAGEFORMAT, "E01B5D", "EDEDED", sClientName, "C9EF66", "B2B2B2", sClientAuth, "C9EF66", "Item Pickup", sItemColor, sItemName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -124,6 +139,7 @@ public void EW_OnClientItemPickup(int client, int index)
|
||||
public void EW_OnClientItemDisconnect(int client, int index)
|
||||
{
|
||||
CItem item = EW_GetItemData(index);
|
||||
int iTeam = GetClientTeam(client);
|
||||
|
||||
if (item.dConfig.bDisplayEventMessages)
|
||||
{
|
||||
@ -142,7 +158,11 @@ public void EW_OnClientItemDisconnect(int client, int index)
|
||||
item.dConfig.GetColor(sItemColor, sizeof(sItemColor));
|
||||
|
||||
CRemoveTags(sClientName, sizeof(sClientName));
|
||||
CPrintToChatAll(MESSAGEFORMAT, "E01B5D", "EDEDED", sClientName, "F1B567", "B2B2B2", sClientAuth, "F1B567", "Item Disconnect", sItemColor, sItemName);
|
||||
for(int i = 1; i <= MaxClients; i++)
|
||||
{
|
||||
if(CheckIfTeamOrAdmin(iTeam, i))
|
||||
CPrintToChat(i, MESSAGEFORMAT, "E01B5D", "EDEDED", sClientName, "67ADDF", "B2B2B2", sClientAuth, "67ADDF", "Item Activate", sItemColor, sItemName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -152,6 +172,7 @@ public void EW_OnClientItemDisconnect(int client, int index)
|
||||
public void EW_OnClientItemActivate(int client, int index)
|
||||
{
|
||||
CItem item = EW_GetItemData(index);
|
||||
int iTeam = GetClientTeam(client);
|
||||
|
||||
if (item.dConfig.bDisplayActivateMessages)
|
||||
{
|
||||
@ -170,6 +191,21 @@ public void EW_OnClientItemActivate(int client, int index)
|
||||
item.dConfig.GetColor(sItemColor, sizeof(sItemColor));
|
||||
|
||||
CRemoveTags(sClientName, sizeof(sClientName));
|
||||
CPrintToChatAll(MESSAGEFORMAT, "E01B5D", "EDEDED", sClientName, "67ADDF", "B2B2B2", sClientAuth, "67ADDF", "Item Activate", sItemColor, sItemName);
|
||||
for(int i = 1; i <= MaxClients; i++)
|
||||
{
|
||||
if(CheckIfTeamOrAdmin(iTeam, i))
|
||||
CPrintToChat(i, MESSAGEFORMAT, "E01B5D", "EDEDED", sClientName, "E562BA", "B2B2B2", sClientAuth, "E562BA", "Item Activate", sItemColor, sItemName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
public bool CheckIfTeamOrAdmin(int team, int client)
|
||||
{
|
||||
if(client > 0 && client <= MaxClients && IsClientInGame(client) && (team == GetClientTeam(client) || CheckCommandAccess(client, "", ADMFLAG_GENERIC)))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
Loading…
Reference in New Issue
Block a user