This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Top 3 Reward


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Divin12
Senior Member
Join Date: Nov 2011
Old 06-04-2017 , 16:01   Re: Top 3 Reward
Reply With Quote #4

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[] namebool dontBroadcast)
{
    new 
firstct[MaxClients 1], firstt[MaxClients 1];
    new 
ij;
    for(
1MaxClientsi++) 
    {
        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(
1MaxClientsi++) 
    {
        for(
i+1MaxClientsj++)
        {
            if(
firstt[i] >= firstt[j])
            {
                
firstt[j] = 0;
            }
            if(
firstct[i] >= firstct[j])
            {
                
firstct[j] = 0;
            }
        }
    }
    for(
1MaxClientsi++) 
    {
        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.
__________________
Divin12 is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:53.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode