Raised This Month: $ Target: $400
 0% 

round start


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GhostMan
Senior Member
Join Date: Jun 2012
Old 07-10-2012 , 06:19   round start
Reply With Quote #1

PHP Code:
        register_event("HLTV""event_round_start""a""1=0""2=0")
    
register_logevent("round_start"2"0=World triggered""1=Round_Start")
    
register_logevent("round_start"2"0=World triggered""1=Game_Commencing")
    
register_logevent("round_start"2"0=World triggered""1&Restart_Round_"
whats the difference between all those "round start" events?

Last edited by GhostMan; 07-10-2012 at 06:20.
GhostMan is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 07-10-2012 , 06:25   Re: round start
Reply With Quote #2

You can see the last arguments:
1. Called on round start (after freezetime)
2. Called on "Game Commencing" (when the game restarts after a second player enters the server)
3. Called on round restarting (sv_restart/sv_restartround)

They can all be set in only one native call:
PHP Code:
register_logevent("round_start"2"0=World triggered""1=Round_Start","1=Game_Commencing","1&Restart_Round_"
__________________

Last edited by <VeCo>; 07-10-2012 at 06:25.
<VeCo> is offline
GhostMan
Senior Member
Join Date: Jun 2012
Old 07-10-2012 , 06:39   Re: round start
Reply With Quote #3

Okay, then whats the difference between those 3 you mentioned and this one?

register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
GhostMan is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 07-10-2012 , 06:45   Re: round start
Reply With Quote #4

This one is called on round start BEFORE freezetime.
__________________

Last edited by <VeCo>; 07-10-2012 at 06:45.
<VeCo> is offline
GhostMan
Senior Member
Join Date: Jun 2012
Old 07-10-2012 , 07:41   Re: round start
Reply With Quote #5

If im doing team_count
PHP Code:
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)]++

So i guess its better to do it on round start like this

register_logevent("round_start", 2, "0=World triggered", "1=Round_Start","1=Game_Commencing","1&Restart_Round_")

Last edited by GhostMan; 07-10-2012 at 07:42.
GhostMan is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 07-10-2012 , 08:41   Re: round start
Reply With Quote #6

You can use get_players native for better work.
__________________
<VeCo> is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 07-10-2012 , 10:56   Re: round start
Reply With Quote #7

Quote:
Originally Posted by GhostMan View Post
So i guess its better to do it on round start like this
Good choice. The player's won't have spawned on HLTV Event.

This is better, and don't forget that unassigned players and spectators are not alive.
Code:
new iPlayers[ 32 ]; get_players( iPlayers, g_TeamAlive[ CS_TEAM_CT ], "aeh", "CT" ); get_players( iPlayers, g_TeamAlive[ CS_TEAM_T ], "aeh", "TERRORIST" );
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
GhostMan
Senior Member
Join Date: Jun 2012
Old 07-10-2012 , 11:31   Re: round start
Reply With Quote #8

Okay, so now im useing this team_count to get know when theres 2 alive t's left so that /box function would be available.

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)]++

I run team_count when round start, player disconnect and on DeathMsg. But you saind, that i can delete all that team_count stuff and to just like that?

PHP Code:
public cmd_box(id) {

    new 
iPlayers32 ];

    if(
is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_CT) {    

        
get_playersiPlayersg_TeamAliveCS_TEAM_T ], "aeh""TERRORIST" );

        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

GhostMan 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 15:22.


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