Raised This Month: $ Target: $400
 0% 

Need someone to Edit Script


Post New Thread Reply   
 
Thread Tools Display Modes
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
Old 07-26-2010, 17:52
Kantel
This message has been deleted by Kantel. Reason: I'm impatient
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-26-2010 , 18:24   Re: Ratio'ing teams help
Reply With Quote #3

Quote:
Originally Posted by Kantel View Post
Bump ):
You can wait.
__________________
fysiks is offline
Old 07-26-2010, 18:25
Kantel
This message has been deleted by Kantel. Reason: More impatientness
Kantel
Junior Member
Join Date: Jul 2010
Location: SoCal
Old 07-27-2010 , 16:11   Re: Need someone to Edit Script
Reply With Quote #5

Help please
Kantel is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-27-2010 , 16:28   Re: Need someone to Edit Script
Reply With Quote #6

Your code is will not work. There are a few team management plugins that already exist and code on the forums that can help with catching team changes and acting on them.
__________________
Bugsy is offline
Kantel
Junior Member
Join Date: Jul 2010
Location: SoCal
Old 07-27-2010 , 16:35   Re: Need someone to Edit Script
Reply With Quote #7

The ones on forums are not the ones I'm looking for. It sorts the team, not let the person choose what team they want to be on.
Kantel is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-27-2010 , 19:30   Re: Need someone to Edit Script
Reply With Quote #8

Quote:
Originally Posted by Kantel View Post
The ones on forums are not the ones I'm looking for. It sorts the team, not let the person choose what team they want to be on.
He was saying that you can learn from the code of those plugin to figure out how to do certain things that they already do. This is Scripting Help. That's one of the ways to learn.
__________________
fysiks is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-27-2010 , 20:04   Re: Need someone to Edit Script
Reply With Quote #9

Take a look at this

http://forums.alliedmods.net/showthread.php?t=112256
__________________
Bugsy is offline
Kantel
Junior Member
Join Date: Jul 2010
Location: SoCal
Old 07-27-2010 , 20:57   Re: Need someone to Edit Script
Reply With Quote #10

I saw that thread, but as the author mentions, that script does not work. So learning from a script that doesn't work = pointless. I did see however the other ratio someone else posted within the thread, but that too isn't what I'm looking for.
I'll attempt to learn from those scripts though, I'll post back with what I come up with and see if you guys can further my knowledge maybe? Thanks for the help
Kantel is offline
Reply



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