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

detect whether round is started


Post New Thread Reply   
 
Thread Tools Display Modes
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 11-26-2011 , 05:43   Re: detect whether round is started
Reply With Quote #11

So, i was right
Devil259 is offline
Erox902
Veteran Member
Join Date: Jun 2009
Location: Never Never Land
Old 11-26-2011 , 10:05   Re: detect whether round is started
Reply With Quote #12

Quote:
Originally Posted by ^SmileY View Post
register_logevent("round_start", 2, "1=Round_Start") >> After Freezetime's end.
Exactly... And if you'll look down on the clock you'll see that after the freezetime it will start counting down.
That's cuz' the round is starting.

He wanted to know if the round was started.

HLTV event can also be the round start event if you don't have any freezetime.
But however it will not get called if there ain't no players on the server.
And if there are players on the server it will get called as many times as players on the server.

Quote:
Originally Posted by Devil259 View Post
So, i was right
So no not exactly, but if smileys comment actually were logic then yes. You would've been correct.

Last edited by Erox902; 11-26-2011 at 10:10.
Erox902 is offline
JoKeR LauGh
Veteran Member
Join Date: May 2011
Location: Malaysia
Old 12-11-2011 , 23:42   Re: detect whether round is started
Reply With Quote #13

hey guys , is it necessary to put id on round start public?

Code:
new bool:bRoundIsStarted public plugin_init( ) {      register_logevent( "NewRound", 2, "1=Round_Start" ) } public NewRound(id) {      bRoundIsStarted = true }
__________________
Quote:
Originally Posted by addons_zz View Post
Also, just to not read `the article`, read all you find. Read and read, for ever and ever. Never stop reading.
Why? Because there is not one single universal truth which holds the meaning for everything.
JoKeR LauGh is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 12-12-2011 , 05:14   Re: detect whether round is started
Reply With Quote #14

For hltv_event its a HL engine event, not an special CS 1.6 using freezetime....
Its userful to adjust witch an freezetime in server.

For HLTV Event, but using freezetime its:

PHP Code:
#include <amxmodx>

#pragma semicolon 1

#define TASKID 2541

new p_Freezetime;
new 
g_Rounds;

public 
plugin_init() 
{
    
register_plugin("Testing Events",AMXX_VERSION_STR,"SmileY");
    
    
register_event("HLTV","round_start","a","1=0","2=0");
    
    
p_Freezetime get_cvar_pointer("mp_freezetime");
}

public 
round_start()
{
    new 
FloatFreezetime get_pcvar_float(p_Freezetime);
    
    if(
Freezetimeset_task(Freezetime,"RoundBegin",TASKID);
    
    else 
set_task(0.1,"RoundBegin",TASKID);
}

public 
RoundBegin() client_print(0,3,"[AMXX] Round %d LIVE, have fun :)",++g_Rounds); 
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 

Last edited by ^SmileY; 12-12-2011 at 05:22. Reason: :P, V2
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
Erox902
Veteran Member
Join Date: Jun 2009
Location: Never Never Land
Old 12-12-2011 , 07:49   Re: detect whether round is started
Reply With Quote #15

Quote:
Originally Posted by JoKeR LauGh View Post
hey guys , is it necessary to put id on round start public?
No Round_Start is a global event, so there's no index specified.

@^SmileY
If I remember correctly there should be an index specified for HLTV event. (Since it gets called for every player. )
Also that set_task you're setting in that function will get called as many times as there are players on the server.
Erox902 is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 12-12-2011 , 08:15   Re: detect whether round is started
Reply With Quote #16

Use a simple loop and adjust the "a" flag not?
__________________
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
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 12-12-2011 , 10:47   Re: detect whether round is started
Reply With Quote #17

PHP Code:
#include <amxmodx>

new g_roundstarted
new g_maxplayers

public plugin_init()
{
    
register_plugin("Check Round Started""1.0.0""YourNameHere")
    
    
register_event("HLTV""event_round_start""a""1=0""2=0")
    
register_logevent("logevent_round_start",2"1=Round_Start")
    
    
g_maxplayers get_maxplayers()
}

// New round begin
public event_round_start()
{
    
g_roundstarted 0
    client_print
(0,print_chat"New round begin wait until freezetime over...")
    
    
// Want use index?
    
for(new i=1;i<=g_maxplayers;i++)
    {
        if(
is_user_connected(i))
        {
            
// Put your function here
        
}
    }
}

// Round has started
public logevent_round_start()
{
    
g_roundstarted 1
    client_print
(0,print_chat"Round has started, go blablabla...")
    
    
// Want use index?
    
for(new i=1;i<=g_maxplayers;i++)
    {
        if(
is_user_connected(i))
        {
            
// Put your function here
        
}
    }

__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
JoKeR LauGh
Veteran Member
Join Date: May 2011
Location: Malaysia
Old 12-12-2011 , 10:56   Re: detect whether round is started
Reply With Quote #18

cannot right this? sorry for my low knowledge
PHP Code:
static id
id 

__________________
Quote:
Originally Posted by addons_zz View Post
Also, just to not read `the article`, read all you find. Read and read, for ever and ever. Never stop reading.
Why? Because there is not one single universal truth which holds the meaning for everything.
JoKeR LauGh is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 12-12-2011 , 11:04   Re: detect whether round is started
Reply With Quote #19

Quote:
Originally Posted by JoKeR LauGh View Post
cannot right this? sorry for my low knowledge
PHP Code:
static id
id 

Do you know what is looping? Show your full code.

Ok tell me why want use static? use basic is enough.
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
JoKeR LauGh
Veteran Member
Join Date: May 2011
Location: Malaysia
Old 12-12-2011 , 11:11   Re: detect whether round is started
Reply With Quote #20

Quote:
Originally Posted by JoKeR LauGh View Post
cannot right this? sorry for my low knowledge
PHP Code:
static id
id 

Doing a private plugin , strip user weapon when the round comes .

MY : loop = gelung
__________________
Quote:
Originally Posted by addons_zz View Post
Also, just to not read `the article`, read all you find. Read and read, for ever and ever. Never stop reading.
Why? Because there is not one single universal truth which holds the meaning for everything.
JoKeR LauGh 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 07:43.


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