Raised This Month: $ Target: $400
 0% 

Game Commening


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
edgaras85
Senior Member
Join Date: Mar 2010
Location: Lithuania
Old 06-15-2010 , 18:39   Game Commening
Reply With Quote #1

How to make if game commening that my cvar would set to 0?
can someone make example pls?
edgaras85 is offline
RedRobster
Veteran Member
Join Date: Apr 2010
Location: Your Closet
Old 06-15-2010 , 19:59   Re: Game Commening
Reply With Quote #2

Assuming that "game commencing" occurs before freezetime...here you go.

PHP Code:
#include <amxmodx>
 
#define PLUGIN "WOOT"
#define VERSION "564654"
#define AUTHOR "LOLZ"
 
new Cvar
 
public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
 
    
Cvar register_cvar("CvarOne","1")
 
    
register_logevent("Round_Start",2,"1=Round_Start")
}
 
public 
Round_Start()
{
    
set_pcvar_num(Cvar,0)

RedRobster is offline
edgaras85
Senior Member
Join Date: Mar 2010
Location: Lithuania
Old 06-16-2010 , 04:21   Re: Game Commening
Reply With Quote #3

Quote:
Originally Posted by RedRobster View Post
Assuming that "game commencing" occurs before freezetime...here you go.

PHP Code:
#include <amxmodx>
 
#define PLUGIN "WOOT"
#define VERSION "564654"
#define AUTHOR "LOLZ"
 
new Cvar
 
public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
 
    
Cvar register_cvar("CvarOne","1")
 
    
register_logevent("Round_Start",2,"1=Round_Start")
}
 
public 
Round_Start()
{
    
set_pcvar_num(Cvar,0)

I think thats not roundstart...
Look like playging 2 guys on 6 round
one left
connected other and game commening
and again round 1 so i need to set Cvar to 0
edgaras85 is offline
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 06-16-2010 , 04:27   Re: Game Commening
Reply With Quote #4

Maybe this?
Code:
new pcvar

public plugin_init ( )
{
    ....
    
    register_event ( "TextMsg", "EV_TextMsg", "a", "2=#Game_Commencing" )
    
    pcvar = register_cvar ( "cvar", "1" )
}

public EV_TextMsg ( )
{
    set_pcvar_num ( pcvar, 0 )
}
__________________

NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 06-16-2010 , 11:28   Re: Game Commening
Reply With Quote #5

I'm not sure if it's anyhow better but I'd use this logevent:
Code:
register_logevent("GameCommencing", 2, "1=Game_Commencing");
__________________
hleV is offline
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 06-16-2010 , 12:25   Re: Game Commening
Reply With Quote #6

Quote:
Originally Posted by hleV View Post
I'm not sure if it's anyhow better but I'd use this logevent:
Code:
register_logevent("GameCommencing", 2, "1=Game_Commencing");
Might work. Anyway the #2 post is totally wrong.
U can always detect when the 2nd player is joining and the 2nd players spawns its game commencing
__________________
I am out of order!
grimvh2 is offline
Old 06-16-2010, 15:02
edgaras85
This message has been deleted by edgaras85. Reason: Offtopic
edgaras85
Senior Member
Join Date: Mar 2010
Location: Lithuania
Old 06-16-2010 , 18:08   Re: Game Commening
Reply With Quote #8

Quote:
Originally Posted by hleV View Post
I'm not sure if it's anyhow better but I'd use this logevent:

Code:
register_logevent("GameCommencing", 2, "1=Game_Commencing");
Thanks Hlev This works
edgaras85 is offline
Bello
BANNED
Join Date: Jun 2010
Old 06-16-2010 , 20:17   Re: Game Commening
Reply With Quote #9

Hello a question i have this code for blocked game comencing:

PHP Code:
public plugin_init()
    {
         
register_message(get_user_msgid("TextMsg"), "message_TextMsg")
    }

public 
message_TextMsg(msg_idmsg_destmsg_entity)
    {
        static 
buffer[32]
    
        
get_msg_arg_string(2buffer31)
    
        if(
equal(buffer"#Game_Commencing") || equal(buffer"#Game_will_restart_in"))
            return 
PLUGIN_HANDLED
    
        
return PLUGIN_CONTINUE
    

The code eliminates the game comencing, but does not eliminate the restart that runs the game comencing as could eliminate the restart that runs the game comencing?
Bello 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 14:46.


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