#pragma semicolon 1
#define RP "Respawn"
#undef REQUIRE_PLUGIN
#tryinclude <vip_core>
#tryinclude <shop>
#pragma newdecls required
ArrayList g_aSteamIDs;
public void OnPluginStart()
{
g_aSteamIDs = CreateArray(64);
AddCommandListener(Join, "jointeam");
HookEvent("round_end", Event_OnRoundEnd);
}
public void Event_OnRoundEnd(Event event, const char[] name, bool dontBroadcast) { g_aSteamIDs.Clear(); }
public Action Join(int client, const char[] command, int args)
{
if (IsClientInGame(client))
{
#if defined _vip_core_included
if (!VIP_IsClientVIP(client) && VIP_IsClientFeatureUse(iClient, RP))
{
#elseif defined _shop_included
if (Shop_IsAuthorized(client) && Shop_GetItemValue(Shop_GetItemId(Shop_GetCategoryId("stuff"), RP) == 0)
{
#endif
char sSteam[32];
if (GetClientAuthId(client, AuthId_Steam2, sSteam, sizeof(sSteam)))
{
if (g_aSteamIDs.FindString(sSteam) == -1)g_aSteamIDs.PushString(sSteam);
else return Plugin_Handled;
}
#if defined _vip_core_included || defined _shop_included
}
#endif
}
return Plugin_Continue;
}