Raised This Month: $12 Target: $400
 3% 

biohazard cs_set_team [ tag mismatch ]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CryWolf
Veteran Member
Join Date: Jul 2008
Location: Romania
Old 09-27-2013 , 03:43   biohazard cs_set_team [ tag mismatch ]
Reply With Quote #1

Hallo my fellow scripters, today i just whanted to convert biohazard cs_set_user_team with claudiu's module CS Team Changer https://forums.alliedmods.net/showthread.php?t=163555 but i just whent in some little trouble , i will give the code for a better understand
here is before i modified
HTML Code:
	/* static players[CsTeams:3][32], count[CsTeams:3], i, id, CsTeams:team
	get_players(players[CS_TEAM_UNASSIGNED], count[CS_TEAM_UNASSIGNED])
	count[CS_TEAM_T] = 0, count[CS_TEAM_CT] = 0
	
	for(i = 0; i < count[CS_TEAM_UNASSIGNED]; i++)
	{
		id = players[CS_TEAM_UNASSIGNED][i], team = cs_get_user_team(id)
		if(team == CS_TEAM_T || team == CS_TEAM_CT)
			players[team][count[team]++] = id
	}

	if(abs(count[CS_TEAM_T] - count[CS_TEAM_CT]) <= 1) return

	static maxplayers; maxplayers = (count[CS_TEAM_T] + count[CS_TEAM_CT]) / 2
	if(count[CS_TEAM_T] > maxplayers)
	{
		for(i = 0; i < (count[CS_TEAM_T] - maxplayers); i++)
			cs_set_user_team(players[CS_TEAM_T][i], CS_TEAM_CT)
	}
	else
	{
		for(i = 0; i < (count[CS_TEAM_CT] - maxplayers); i++)
			cs_set_user_team(players[CS_TEAM_CT][i], CS_TEAM_T)
	} */
and here are the modifications
HTML Code:
	static players [ teams:3 ] [ 32 ], count [ teams: 3 ], i, id, team;
	get_players ( players [ CSTEAM_UNASSIGNED ], count [ CSTEAM_UNASSIGNED ] )
	count [ CSTEAM_TERRORIST ] = 0, count [ CSTEAM_CT ] = 0
	
	for ( i = 0; i < count [ CSTEAM_UNASSIGNED ]; i++ )
	{
		id = players [ CSTEAM_UNASSIGNED ] [ i ], team = get_user_team ( id )
		if ( team == CSTEAM_TERRORIST || CSTEAM_CT )
			players [ team ] [ count [ team ] ++ ] = id
	}
	
	if ( abs ( count [ CSTEAM_TERRORIST ] - count [ CSTEAM_CT ] ) <= 1 ) return
	
	static maxplayers; maxplayers = ( count [ CSTEAM_TERRORIST ] + count [ CSTEAM_CT ] ) / 2
	if ( count [ CSTEAM_TERRORIST ] > maxplayers )
	{
		for ( i = 0; i < ( count [ CSTEAM_TERRORIST ] - maxplayers ); i++ )
			cs_set_team ( players [ CSTEAM_TERRORIST ] [ i ], CSTEAM_CT )
	}
	else
	{
		for ( i = 0; i < ( count [ CSTEAM_CT ] - maxplayers ); i++ )
			cs_set_team ( players [ CSTEAM_CT ] [ i ], CSTEAM_TERRORIST )
	}
on every line i have tag mismatch, form the first one to the last one
Code:
//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// biohazard.sma
// D:\Programe\HLDS\bhscripting\biohazard.sma(1267) : warning 213: tag mismatch
// D:\Programe\HLDS\bhscripting\biohazard.sma(1267) : warning 213: tag mismatch
// D:\Programe\HLDS\bhscripting\biohazard.sma(1268) : warning 213: tag mismatch
// D:\Programe\HLDS\bhscripting\biohazard.sma(1268) : warning 213: tag mismatch
// D:\Programe\HLDS\bhscripting\biohazard.sma(1270) : warning 213: tag mismatch
// D:\Programe\HLDS\bhscripting\biohazard.sma(1272) : warning 213: tag mismatch
// D:\Programe\HLDS\bhscripting\biohazard.sma(1274) : warning 213: tag mismatch
// D:\Programe\HLDS\bhscripting\biohazard.sma(1274) : warning 213: tag mismatch
// D:\Programe\HLDS\bhscripting\biohazard.sma(1277) : warning 213: tag mismatch
// D:\Programe\HLDS\bhscripting\biohazard.sma(1277) : warning 213: tag mismatch
// D:\Programe\HLDS\bhscripting\biohazard.sma(1279) : warning 213: tag mismatch
// D:\Programe\HLDS\bhscripting\biohazard.sma(1279) : warning 213: tag mismatch
// D:\Programe\HLDS\bhscripting\biohazard.sma(1280) : warning 213: tag mismatch
// D:\Programe\HLDS\bhscripting\biohazard.sma(1282) : warning 213: tag mismatch
// D:\Programe\HLDS\bhscripting\biohazard.sma(1283) : warning 213: tag mismatch
// D:\Programe\HLDS\bhscripting\biohazard.sma(1287) : warning 213: tag mismatch
// D:\Programe\HLDS\bhscripting\biohazard.sma(1288) : warning 213: tag mismatch
// Header size:           4880 bytes
// Code size:            62988 bytes
// Data size:            29160 bytes
// Stack/heap size:      32768 bytes; estimated max. usage=785 cells (3140 bytes
)
// Total requirements:  129796 bytes
//
// 17 Warnings.
// Done.
//
// Compilation Time: 1,7 sec
// ----------------------------------------

Press enter to exit ...
Some help ? thanks, i need to use this module CSTRIKE module crashes on full server!
__________________
I dont walk trough this world with fear in my heart.
www.dark-arena.com L4D, CS1.6, CZ Servers
CryWolf is offline
Send a message via MSN to CryWolf Send a message via Yahoo to CryWolf
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 09-27-2013 , 09:30   Re: biohazard cs_set_team [ tag mismatch ]
Reply With Quote #2

The module doesn't work, just add a delay at your teamchange stuff to prevent crash / kicking players.
__________________
Kia is offline
CryWolf
Veteran Member
Join Date: Jul 2008
Location: Romania
Old 09-28-2013 , 03:51   Re: biohazard cs_set_team [ tag mismatch ]
Reply With Quote #3

Thanks kia, but i have solved from yesterday, used another way, that module works verry well for me, if you know what i mean!

Thanks again! @solved
__________________
I dont walk trough this world with fear in my heart.
www.dark-arena.com L4D, CS1.6, CZ Servers
CryWolf is offline
Send a message via MSN to CryWolf Send a message via Yahoo to CryWolf
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 09-28-2013 , 06:25   Re: biohazard cs_set_team [ tag mismatch ]
Reply With Quote #4

If you have more than 17 players and want to switch the teams for all players, they probably will get a SVC_BAD and will be kicked.
__________________
Kia is offline
CryWolf
Veteran Member
Join Date: Jul 2008
Location: Romania
Old 09-28-2013 , 08:26   Re: biohazard cs_set_team [ tag mismatch ]
Reply With Quote #5

Man i think i dont follow you, you're trying to say that the specified module will crash my server ? i have just tested yet with 24 bots seems okay, transfered all at round start from terror to random teams, he did not crashed , what i was trying to say on my prev post is that i am using a stable hlds version witch allows me to still run that module fine.

I don't whant to revert all the biohazard team switch from that module back to cstrike or worst i think fakemeta!

FakeMeta it's better than that module, using fakemeta with delay ?
__________________
I dont walk trough this world with fear in my heart.
www.dark-arena.com L4D, CS1.6, CZ Servers
CryWolf is offline
Send a message via MSN to CryWolf Send a message via Yahoo to CryWolf
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 09-28-2013 , 09:47   Re: biohazard cs_set_team [ tag mismatch ]
Reply With Quote #6

Quote:
Originally Posted by CryWolf View Post
Man i think i dont follow you, you're trying to say that the specified module will crash my server ? i have just tested yet with 24 bots seems okay, transfered all at round start from terror to random teams, he did not crashed , what i was trying to say on my prev post is that i am using a stable hlds version witch allows me to still run that module fine.

I don't whant to revert all the biohazard team switch from that module back to cstrike or worst i think fakemeta!

FakeMeta it's better than that module, using fakemeta with delay ?
With Bots it's not the same.

This code is working fine for me (taken from Exolents HnS Plugins)
PHP Code:
    static iCountclient;
    
    
iCount 0;
    
    for( 
client 0client <= g_iMaxPlayersclient++ )
    {
        if( 
is_user_connectedclient ) )
        {
            if( 
iCount >= SWAP_PER_INTERVAL )
            {
                
set_taskSWAP_INTERVAL"Event_CTWin"TASK_ID_SWAPTEAMS );
            }
            
            switch( 
cs_get_user_teamclient ) )
            {
                case 
CS_TEAM_T:
                {
                    
cs_set_user_teamclientCS_TEAM_CTCS_CT_GIGN );
                    
                    
iCount++;
                }
                case 
CS_TEAM_CT:
                {
                    
cs_set_user_teamclientCS_TEAM_TCS_T_LEET );
                    
                    
iCount++;
                }
            }
        }
    }
    
    
remove_task(TASK_ID_SWAPTEAMS
__________________

Last edited by Kia; 09-28-2013 at 09:47.
Kia is offline
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 05-22-2014 , 19:55   Re: biohazard cs_set_team [ tag mismatch ]
Reply With Quote #7

Quote:
Originally Posted by Kia View Post
With Bots it's not the same.

This code is working fine for me (taken from Exolents HnS Plugins)
PHP Code:
    static iCountclient;
    
    
iCount 0;
    
    for( 
client 0client <= g_iMaxPlayersclient++ )
    {
        if( 
is_user_connectedclient ) )
        {
            if( 
iCount >= SWAP_PER_INTERVAL )
            {
                
set_taskSWAP_INTERVAL"Event_CTWin"TASK_ID_SWAPTEAMS );
            }
            
            switch( 
cs_get_user_teamclient ) )
            {
                case 
CS_TEAM_T:
                {
                    
cs_set_user_teamclientCS_TEAM_CTCS_CT_GIGN );
                    
                    
iCount++;
                }
                case 
CS_TEAM_CT:
                {
                    
cs_set_user_teamclientCS_TEAM_TCS_T_LEET );
                    
                    
iCount++;
                }
            }
        }
    }
    
    
remove_task(TASK_ID_SWAPTEAMS
Can you explain to me how to put this in my biohazard plugin?
__________________
Check my original plugins for cs 1.6 and subscribe on channel
Look at the video below to see blind grenade for zombies

https://www.youtube.com/watch?v=ORC7ZmoaipQ

Look at the video below to see Zombie Hide And Seek mode

https://www.youtube.com/watch?v=xpyYb65EgGs
Krtola is offline
Send a message via Skype™ to Krtola
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:08.


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