Raised This Month: $ Target: $400
 0% 

Need someone to Edit Script


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Kantel
Junior Member
Join Date: Jul 2010
Location: SoCal
Old 07-26-2010 , 13:34   Need someone to Edit Script
Reply With Quote #1

Need help editing. Fairly new to coding, took reasoning from tutorials and other works.
Scenario: Player joins server, if the teams are 10T : 5CT, switch to T based on 2:1 ratio.
Switching teams it must be 13T : 5CT or else stay whichever team player is at.
Did I script this right to follow the scenario?

Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <cstrike>

#define PLUGIN "Ratio Manager"
#define VERSION "1.1"
#define AUTHOR "T3A"


public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
}
enum CsTeams {
    CS_TEAM_UNASSIGNED = 0,
    CS_TEAM_T,
    CS_TEAM_CT,
    CS_TEAM_SPECTATOR,
};
stock get_new_team(iCvar)
{
    switch(iCvar)
    {
        new iTeam;
        
        new iTCount = g_iPlayers[TEAM_T];
        new iCTCount = g_iPlayers[TEAM_CT];
        if (iTCount /2 +2 < iCTcount)
        {
            return TEAM_T;
        }
        else
        return iTeam;
    }
}
stock get_switch_team(id)
{
    new iTeam;
    
    new iTCount = g_iPlayers[TEAM_T]
    new iCTCount = g_iPlayers[TEAM_CT]
    {
        case TEAM_T: iTCount
        case TEAM_CT: iCTCount
    }
    if (iTCount /2 +3 > iCTCount)
    {
        return iTeam
    }
    else
    {
        return TEAM_T
    }
}

Last edited by Kantel; 07-26-2010 at 19:33.
Kantel 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 00:14.


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