AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved respawn as CT (https://forums.alliedmods.net/showthread.php?t=333841)

1M1e 08-09-2021 15:35

respawn as CT
 
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

Bugsy 08-09-2021 16:42

Re: respawn as CT
 
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];
    }



1M1e 08-09-2021 17:09

Re: respawn as CT
 
thanks its work


All times are GMT -4. The time now is 03:48.

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