Skip to content

Commit

Permalink
add dominatingme symbols for wr holders on a map
Browse files Browse the repository at this point in the history
  • Loading branch information
rtldg committed Sep 5, 2021
1 parent f10fd56 commit 4d03e30
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions addons/sourcemod/scripting/shavit-wr.sp
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ public void OnPluginStart()
Shavit_OnChatConfigLoaded();
Shavit_OnDatabaseLoaded();
}

CreateTimer(2.5, Timer_Dominating, 0, TIMER_REPEAT);
}

public void OnAllPluginsLoaded()
Expand Down Expand Up @@ -317,6 +319,34 @@ public void OnLibraryRemoved(const char[] name)
}
}

public Action Timer_Dominating(Handle timer)
{
bool bHasWR[MAXPLAYERS+1];

for (int i = 1; i <= MaxClients; i++)
{
if (IsValidClient(i))
{
char sSteamID[20];
IntToString(GetSteamAccountID(i), sSteamID, sizeof(sSteamID));
bHasWR[i] = gSM_WRNames.GetString(sSteamID, sSteamID, sizeof(sSteamID));
}
}

for (int i = 1; i <= MaxClients; i++)
{
if (!IsValidClient(i))
{
continue;
}

for (int x = 1; x <= MaxClients; x++)
{
SetEntProp(i, Prop_Send, "m_bPlayerDominatingMe", bHasWR[x], 1, x);
}
}
}

void ResetWRs()
{
gSM_WRNames.Clear();
Expand Down

0 comments on commit 4d03e30

Please sign in to comment.