PHP Code:
#include <sourcemod>
#include <cstrike>
#include <sdktools>
public void OnPluginStart()
{
if (GetEngineVersion() != Engine_CSGO)
SetFailState("This plugin is only for CS:GO !");
HookEvent("round_start", OnPlayerSpawn);
}
public void OnPlayerSpawn(Handle event, const char[] name, bool dontBroadcast)
{
new firstct[MaxClients + 1], firstt[MaxClients + 1];
new i, j;
for(i = 1; i < MaxClients; i++)
{
if(IsClientInGame(i) && !IsFakeClient(i))
{
new iTeam = GetClientTeam(i);
if(iTeam == CS_TEAM_T)
firstt[i] = CS_GetClientContributionScore(i);
else if(iTeam == CS_TEAM_CT)
firstct[i] = CS_GetClientContributionScore(i);
}
}
for(i = 1; i < MaxClients; i++)
{
for(j = i+1; j < MaxClients; j++)
{
if(firstt[i] >= firstt[j])
{
firstt[j] = 0;
}
if(firstct[i] >= firstct[j])
{
firstct[j] = 0;
}
}
}
for(i = 1; i < MaxClients; i++)
{
if(firstt[i] > 0)
{
GivePlayerItem(i, "item_kevlar");
}
if(firstct[i] > 0)
{
GivePlayerItem(i, "item_kevlar");
}
}
}
This is for first from ct and first from t, not tested, test it and check if it works.
__________________