AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Number of T's (https://forums.alliedmods.net/showthread.php?t=189762)

GhostMan 07-10-2012 16:01

Number of T's
 
Is this code

(team_count i run on DeathMsg, client disconnect, round start)

PHP Code:

public cmd_box(id) {
    if(
is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_CT) {    
        if(
g_TeamAlive[CS_TEAM_T] <= get_pcvar_num(gp_BoxMax) && g_TeamAlive[CS_TEAM_T] > && !g_BoxStarted) {
            static 
i
            
for(1<= g_max_clientsi++)
                if(
is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_T)
                    
set_user_health(i100)

            
boxon true
            set_cvar_num
("mp_tkpunish"0)
            
set_cvar_num("mp_friendlyfire"1)
            
            
g_BoxStarted true
            
            set_hudmessage
(025500.080.2422.06.00.050.22)
            new 
name[33]; get_user_name(idnamecharsmax(name))
            
ShowSyncHudMsg(0g_HudSync"Priziuretojas %s Ijunge BOKSO rezima!"name)
        }
        else {
            
set_hudmessage(255000.080.2422.06.00.050.22)
            
ShowSyncHudMsg(idg_HudSync"Ijungti BOKSO rezimo dabar negalima!")
        }
    }
    return 
PLUGIN_HANDLED
}

public 
team_count() {
    
g_TeamAlive[CS_TEAM_UNASSIGNED] = 0
    g_TeamAlive
[CS_TEAM_T] = 0
    g_TeamAlive
[CS_TEAM_CT] = 0
    g_TeamAlive
[CS_TEAM_SPECTATOR] = 0
    
for(new 1<= g_max_clientsi++)
        if(
is_user_connected(i))
            if(
is_user_alive(i))
                
g_TeamAlive[cs_get_user_team(i)]++


can be replaced with this one?


PHP Code:

public cmd_box(id) {

    new 
iPlayers32 ];
    
get_playersiPlayersg_TeamAliveCS_TEAM_T ], "aeh""TERRORIST" );
        
    if(
is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_CT) {    

        if(
g_TeamAlive[CS_TEAM_T] <= get_pcvar_num(gp_BoxMax) && g_TeamAlive[CS_TEAM_T] > && !g_BoxStarted) {
            static 
i
            
for(1<= g_max_clientsi++)
                if(
is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_T)
                    
set_user_health(i100)

            
boxon true
            set_cvar_num
("mp_tkpunish"0)
            
set_cvar_num("mp_friendlyfire"1)
            
            
g_BoxStarted true
            
            set_hudmessage
(025500.080.2422.06.00.050.22)
            new 
name[33]; get_user_name(idnamecharsmax(name))
            
ShowSyncHudMsg(0g_HudSync"Priziuretojas %s Ijunge BOKSO rezima!"name)
        }
        else {
            
set_hudmessage(255000.080.2422.06.00.050.22)
            
ShowSyncHudMsg(idg_HudSync"Ijungti BOKSO rezimo dabar negalima!")
        }
    }
    return 
PLUGIN_HANDLED



hornet 07-10-2012 22:00

Re: Number of T's
 
You already asked this in your other thread. You waited only less than 6 hours ...


All times are GMT -4. The time now is 15:14.

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