Raised This Month: $318 Target: $400
 79%   Almost there!

[CS:GO] Anti-RoundDraw Plugin (Paid?)


Post New Thread Reply   
 
Thread Tools Display Modes
fiction
Member
Join Date: May 2017
Old 09-07-2017 , 19:37   Re: [CS:GO] Anti-RoundDraw Plugin (Paid?)
Reply With Quote #11

Quote:
Originally Posted by darthelmo1 View Post
Sorry for abandoning this thread. Your timers are a bit messed up and you didn't actually include a section to add to the team's score. As of now this plugin is still a WIP -- basic functionality works but doesn't do what we need it to (yet). I'll reply with some help once we fix it.
Should work.
PHP Code:
#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>
#include <sdktools>
#include <cstrike>

public void OnPluginStart()
{
    
HookEvent("round_end"Event_RoundEnd);
}

public 
void Event_RoundEnd(Event event, const char[] namebool dontBroadcast)
{
    static 
int iRoundsPlayed;
    if(
GameRules_GetProp("m_bWarmupPeriod") == 1)
        return;
    
    
GameRules_SetProp("m_totalRoundsPlayed", ++iRoundsPlayed);
}

public 
Action CS_OnTerminateRound(float &delayCSRoundEndReason &reason)
{
    
    if(
reason == CSRoundEnd_Draw)
    {
        
int iTHealthiCTHealth;
        for(
int i 1<= MaxClientsi++)
        {
            if(!
IsClientInGame(i) || !IsPlayerAlive(i))
                continue;

            
int iTeam GetClientTeam(i);
            if(
iTeam <= CS_TEAM_SPECTATOR)
                continue;

            if(
iTeam == CS_TEAM_T)
                
iTHealth += GetClientHealth(i);
            else if(
iTeam == CS_TEAM_CT)
                
iCTHealth += GetClientHealth(i);
        }

        if(
iTHealth == iCTHealth)
            return 
Plugin_Continue;

        if(
iTHealth iCTHealth)
        {
            
reason CSRoundEnd_TerroristWin;
            
            
int iScore GetTeamScore(CS_TEAM_T);
            
SetTeamScore(CS_TEAM_T, (iScore 1));
            
CS_SetTeamScore(CS_TEAM_T, (iScore 1));
        }
        else
        {
            
reason CSRoundEnd_CTWin;
            
            
int iScore GetTeamScore(CS_TEAM_CT);
            
SetTeamScore(CS_TEAM_CT, (iScore 1));
            
CS_SetTeamScore(CS_TEAM_CT, (iScore 1));
        }

        return 
Plugin_Changed;
    }

    return 
Plugin_Continue;


Last edited by fiction; 09-07-2017 at 23:49. Reason: Update rounds remaining.
fiction is offline
Reply


Thread Tools
Display Modes

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 19:59.


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