AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to catch score restart? (https://forums.alliedmods.net/showthread.php?t=217656)

Mofforg 06-05-2013 14:48

How to catch score restart?
 
Hello.


I need to catch score restart to do some actions there. (basically i want to disable plugin and then enabled in 2nd round).

How can i catch score restart (restart round)?

ConnorMcLeod 06-23-2013 05:08

Re: How to catch score restart?
 
This is how you should do :

PHP Code:

#include < amxmodx >

new g_iRoundCount 1;
new 
bool:g_bIsRestarting;

public 
plugin_init()
{
    
register_event("TextMsg""Event_TextMsg_Restart""a""2&#Game_C""2&#Game_w");
    
register_event("HLTV""Event_HLTV_New_Round""a""1=0""2=0");
}

public 
Event_TextMsg_Restart()
{
    
g_bIsRestarting true
}

public 
Event_HLTV_New_Round()
{
    if( 
g_bIsRestarting )
    {
        
g_bIsRestarting false;
        
g_iRoundCount 1;
    }
    else
    {
        ++
g_iRoundCount;
    }




All times are GMT -4. The time now is 16:28.

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