Raised This Month: $ Target: $400
 0% 

[Help]Orpheu: AutoTeamBalances


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 07-06-2014 , 09:51   [Help]Orpheu: AutoTeamBalances
Reply With Quote #1

Hi, i am making an "Instant Team Balances" plugin for CS1.6 Deathmatch gameplay (no roundend). But something goes wrong, the function is called but it not balance the teams but inverted.

For example:
Current TR -- 8 players
Current CT -- 4 players

If one player disconnect then i set AutoTeamBalance after 10 seconds. When the function called, current players will be:
Current TR -- 9 players
Current CT -- 2 players

Orpheu code


Is my math calculation fault or engine fault?
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019

Last edited by yokomo; 07-06-2014 at 09:56.
yokomo is offline
GuskiS
Veteran Member
Join Date: Aug 2007
Location: Latvia
Old 07-06-2014 , 11:38   Re: [Help]Orpheu: AutoTeamBalances
Reply With Quote #2

I can't help you with that orpheu thing but the code looks fine. You could do a debug after calling orpheu function, example, also little improved code:

PHP Code:
public TaskBalanceTeam()
{
    new 
iTR GetPlayerCount(1//T count
    
new iCT GetPlayerCount(2//CT count
    
    //players >= 2 in 1 team, then call BalanceTeams
    
if(abs(iTR-iCT) >= 2)
    {
        
client_print(0print_chat"[ITB] TR: [%d] -- CT: [%d]"iTRiCT//debug chat
        
OrpheuCall(BalanceTeamsGameRules)
        
client_print(0print_center"*** Teams Auto Balanced, Check Your Team ***")
        
client_print(0print_chat"[ITB] NEW TR: [%d] -- CT: [%d]"GetPlayerCount(1), GetPlayerCount(2)) //debug chat
    
}
}

// No need for fakemeta
GetPlayerCount(team)
{
    new 
num;
    static 
players[32];
    
get_players(playersnum"e"team == "TERRORIST" "CT");
    return 
num;

Then you will see where to search for you problem. It might be something with those orpheu files in configs folder?
__________________
Finished mods:
Trouble in Terrorist Town
MurderMod
The Hidden
Cowboys vs Indians
JailBreak Supreme
Survival Madness
GuskiS is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 07-06-2014 , 12:46   Re: [Help]Orpheu: AutoTeamBalances
Reply With Quote #3

If error on Orpheu it will show log and plugin will not running for sure. Signature is correct, as i said function was called. Maybe auto team balance will only called x time in 1 round.

I use this stock for more accurate return.
Code:
//get team player count 1=TR | 2=CT
GetPlayerCount(team)
{
    new j, iCount = 0
    for(j=1;j<=iMaxClients;j++)
    {
        if(!is_user_connected(j)) continue;
        
        if(fm_cs_get_user_team(j) == team) iCount++
    }
    return iCount;
}
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019

Last edited by yokomo; 07-06-2014 at 12:48.
yokomo 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 21:13.


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