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

[ Help ] command at the beginning of the round


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 06-26-2018 , 09:19   [ Help ] command at the beginning of the round
Reply With Quote #1

What is the difference between these and what is more effective:

Code:
new bool:g_freezetime = true;

register_event( "HLTV", "EventNewRound", "a", "1=0", "2=0" );

public EventNewRound( )
{
	g_freezetime = true;
}
- >
Code:
new bool:g_freezetime = true;

register_logevent( "LogEventNewRound", 2, "1=Round_Start" );

public LogEventNewRound( )
{
	g_freezetime = false;
}
The test is like Variables, for example:
PHP Code:
    new Float:maxspeed;
    
pevclientpev_maxspeedmaxspeed );
    
    if( 
maxspeed != 1.0 )
    {
        if( !
g_freezetime )
        {
            switch( 
read_data) )
            {
                case 
CSW_SCOUT:                    maxspeed 260.0;
                case 
CSW_P90:                    maxspeed 245.0;
                case 
CSW_XM1014,CSW_AUG,CSW_GALIL,CSW_FAMAS:    maxspeed 240.0;
                case 
CSW_SG552 :                maxspeed 235.0;
                case 
CSW_M3,CSW_M4A1 :                maxspeed 230.0;
                case 
CSW_AK47 :                    maxspeed 221.0
                case 
CSW_M249 :                     maxspeed 220.0;
                case 
CSW_AWP,CSW_SG550,CSW_G3SG1 :         maxspeed 210.0;
                default :                     
maxspeed 250.0;
            }
        }
        
        
set_pevclientpev_maxspeedmaxspeed );
    } 

Last edited by Fuck For Fun; 06-26-2018 at 09:20.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
maqi
Senior Member
Join Date: Apr 2017
Location: Serbia
Old 06-26-2018 , 10:12   Re: [ Help ] command at the beginning of the round
Reply With Quote #2

HLTV is actually called on round start,

Round start is called after the freeze time
__________________
stuff
maqi is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 06-26-2018 , 10:15   Re: [ Help ] command at the beginning of the round
Reply With Quote #3

Quote:
Originally Posted by maqi View Post
HLTV is actually called on round start,

Round start is called after the freeze time
A bit confuse no?

HLTV event called when freezetime starts,
Round_Start is called after freezetime.

Both events will work to set user speed, but i recommend set after freezetime.
Also if server have mp_freezetime to 0 logevent will be called instantly too.

And in your example, g_freezetime do not need to be used.
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 06-27-2018 , 12:48   Re: [ Help ] command at the beginning of the round
Reply With Quote #4

HLTV is called before players spawn.
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM
Ghosted is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 06-27-2018 , 13:05   Re: [ Help ] command at the beginning of the round
Reply With Quote #5

Quote:
Originally Posted by Ghosted View Post
HLTV is called before players spawn.
It's called after they spawn.

PHP Code:
#include < amxmodx >

public plugin_init( )
{
    
register_event("HLTV""OnNewRound""a" )  ;
}

public 
OnNewRound( )
{
    new 
szPlayers32 ], iNumiTempIDszName32 ];
    
get_playersszPlayersiNum );

    for( new 
iiNumi++ )
    {
        
iTempID szPlayers];
        
get_user_nameiTempIDszNamecharsmaxszName ) );
        
log_to_file"Test.txt""Player: %s %s"szNameis_user_aliveiTempID ) ? "ALIVE" "DEAD" );
    }

Quote:
L 06/27/2018 - 19:02:44: Player: DoNii ALIVE
L 06/27/2018 - 19:02:49: Player: DoNii ALIVE
L 06/27/2018 - 19:02:49: Player: [P*D]U're Dead (100) ALIVE
__________________

Last edited by edon1337; 06-27-2018 at 13:06.
edon1337 is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 06-27-2018 , 13:13   Re: [ Help ] command at the beginning of the round
Reply With Quote #6

Quote:
Originally Posted by edon1337 View Post
It's called after they spawn.

PHP Code:
#include < amxmodx >

public plugin_init( )
{
    
register_event("HLTV""OnNewRound""a" )  ;
}

public 
OnNewRound( )
{
    new 
szPlayers32 ], iNumiTempIDszName32 ];
    
get_playersszPlayersiNum );

    for( new 
iiNumi++ )
    {
        
iTempID szPlayers];
        
get_user_nameiTempIDszNamecharsmaxszName ) );
        
log_to_file"Test.txt""Player: %s %s"szNameis_user_aliveiTempID ) ? "ALIVE" "DEAD" );
    }


You don't have parameters, so this event will be called too many times and this will be OnHLTV and not OnNewRound.

[Parameters:
Code:
"1=0", "2=0"
I Meant NewRound when i was talking about HLTV event]
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM

Last edited by Ghosted; 06-27-2018 at 13:14.
Ghosted is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 06-27-2018 , 13:18   Re: [ Help ] command at the beginning of the round
Reply With Quote #7

Quote:
Originally Posted by Ghosted View Post
You don't have parameters, so this event will be called too many times and this will be OnHLTV and not OnNewRound.

[Parameters:
Code:
"1=0", "2=0"
I Meant NewRound when i was talking about HLTV event]
If I put parameters it will filter out some cases, HLTV is called twice each round, once to reset all players health and once to reset all player FOV. What does the name of the function have to do with anything? It could be any name.

NewRound event doesn't exist.
__________________

Last edited by edon1337; 06-27-2018 at 13:21.
edon1337 is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 06-27-2018 , 13:24   Re: [ Help ] command at the beginning of the round
Reply With Quote #8

Quote:
Originally Posted by edon1337 View Post
If I put parameters it will filter out some cases, HLTV is called twice each round, once to reset all players health and once to reset all player FOV. What does the name of the function have to do with anything? It could be any name.

NewRound event doesn't exist.
I've tested and HLTV was before player spawn.

------------

Quote:
Originally Posted by edon1337 View Post
NewRound event doesn't exist.
Oh, rly?
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM

Last edited by Ghosted; 06-27-2018 at 13:27.
Ghosted is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 06-27-2018 , 13:58   Re: [ Help ] command at the beginning of the round
Reply With Quote #9

Quote:
Originally Posted by Ghosted View Post
I've tested and HLTV was before player spawn.
I already tested and gave you the results, why would I lie about it?

Quote:
Originally Posted by Ghosted View Post
Oh, rly?
Yes, there's no NewRound event in this site.
__________________
edon1337 is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 06-27-2018 , 14:00   Re: [ Help ] command at the beginning of the round
Reply With Quote #10

Quote:
Originally Posted by edon1337 View Post
I already tested and gave you the results, why would I lie about it?



Yes, there's no NewRound event in this site.
No u dont lie but when i used ur style it printed too many times => before and after spawn.


Quote:
Originally Posted by edon1337 View Post
Yes, there's no NewRound event in this site.
Oh, rly?
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM

Last edited by Ghosted; 06-27-2018 at 14:03.
Ghosted is offline
Reply



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 00:08.


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