Raised This Month: $73 Target: $400
 18% 

Solved respawn as CT


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
1M1e
Member
Join Date: Mar 2020
Old 08-09-2021 , 16:35   respawn as CT
Reply With Quote #1

hi,

i have this code

PHP Code:
#include <amxmodx>
#include <amxmisc>

new g_iAliveTNum

public plugin_init() 
{
    
    
set_task(0.1"No_T"___"b")
}


public 
No_T()
{

    
g_iAliveTNum GetAlivePlayersNum(CsTeams:TEAM_TERRORIST)
    
    if (
g_iAliveTNum >= 1)
    {
        
// what should i write here?
    
}

i want when some one join T he will immediately respawn as CT

and the code should effects only on T team Not CT or SPEC

Last edited by 1M1e; 08-09-2021 at 18:09.
1M1e is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-09-2021 , 17:42   Re: respawn as CT
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

new const Version[] = "0.1";

#define MAX_PLAYERS 32

new g_iPrevTeamMAX_PLAYERS ] = { 'U' , ... };

public 
plugin_init() 
{
    
register_plugin"Force CT" Version "bugsy" );

    
register_event"TeamInfo" "EventTeamInfo" "a" );
}

#if AMXX_VERSION_NUM < 190
public client_disconnectid )
#else
public client_disconnectedid )
#endif
{
    
g_iPrevTeamid ] = 'U';
}

public 
EventTeamInfo()
{
    new 
id read_data);
    new 
szTeam]; read_dataszTeam charsmaxszTeam ) );
    
    if ( 
g_iPrevTeamid ] != szTeam] )
    {
        if ( 
szTeam] == 'T' )
        {
            
cs_set_user_teamid CS_TEAM_CT );
            
ExecuteHamHam_CS_RoundRespawn id );
        }
        
        
g_iPrevTeamid ] = szTeam];
    }

__________________
Bugsy is offline
1M1e
Member
Join Date: Mar 2020
Old 08-09-2021 , 18:09   Re: respawn as CT
Reply With Quote #3

thanks its work
1M1e 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 01:24.


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