AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Game Commening (https://forums.alliedmods.net/showthread.php?t=129693)

edgaras85 06-15-2010 18:39

Game Commening
 
How to make if game commening that my cvar would set to 0?
can someone make example pls?

RedRobster 06-15-2010 19:59

Re: Game Commening
 
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)



edgaras85 06-16-2010 04:21

Re: Game Commening
 
Quote:

Originally Posted by RedRobster (Post 1209974)
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

NiHiLaNTh 06-16-2010 04:27

Re: Game Commening
 
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 )
}


hleV 06-16-2010 11:28

Re: Game Commening
 
I'm not sure if it's anyhow better but I'd use this logevent:
Code:
register_logevent("GameCommencing", 2, "1=Game_Commencing");

grimvh2 06-16-2010 12:25

Re: Game Commening
 
Quote:

Originally Posted by hleV (Post 1210512)
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

edgaras85 06-16-2010 18:08

Re: Game Commening
 
Quote:

Originally Posted by hleV (Post 1210512)
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 :)

Bello 06-16-2010 20:17

Re: Game Commening
 
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?


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

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