Playtimereward: even cleaner now!

This commit is contained in:
neon 2018-12-16 14:10:15 +01:00
parent d950f98c9c
commit 93aa3d03b7

View File

@ -47,36 +47,25 @@ public void EventHook_PlayerDisconnect(Event hEvent, const char[] sName, bool bD
public Action Timer_CheckConnectionTime(Handle hThis)
{
for (int i = 1; i <= MaxClients; i++)
{
if (!IsValidClient(i))
continue;
for (int i = 1; i <= MaxClients; i++)
{
if (!IsValidClient(i))
continue;
g_iClientConnectionTime[i] += 30;
g_iClientConnectionTime[i] += 30;
for(int iTime = 1800; iTime <= 36000; iTime += 1800)
{
if ((g_iClientConnectionTime[i] % iTime) == 0)
{
char sPlayerEvent[32];
Format(sPlayerEvent, sizeof(sPlayerEvent), "staying_server_%d", iTime / 60);
char sPlayerEvent[32];
int iTime = 1800;
for (;;)
{
if ((g_iClientConnectionTime[i] / iTime) < 1.0)
{
if (iTime == 1800)
break;
if (iTime >= 36000)
{
LogPlayerEvent(i, "triggered", "staying_server_600");
g_iClientConnectionTime[i] = 0; //start over, but i doubt someone will ever reach so far ;)
}
Format(sPlayerEvent, sizeof(sPlayerEvent), "staying_server_%d", (iTime - 1800) / 60);
LogPlayerEvent(i, "triggered", sPlayerEvent);
break;
}
iTime += 1800;
}
}
LogPlayerEvent(i, "triggered", sPlayerEvent);
break;
}
}
}
}
stock bool IsValidClient(int client)