[STOCK] How to set Freezetime or Roundtime on the fly

For scripting examples for learning how to use AMXX.
User avatar
Archive-Poster
Posts: 1209
Gender:
United States of America

[STOCK] How to set Freezetime or Roundtime on the fly

Post by Archive-Poster »

Hi folks, here is a small stock that adjust freezetime or roundtime on the fly.
I'm tried some time to make this to my mod, i hope someone can re-use for something.

Code: Select all

stock SetRoundTime(iTime)
{
    static iMsgRoundTime;
    
    if(iMsgRoundTime || (iMsgRoundTime = get_user_msgid("RoundTime")))
    {
        if(get_gamerules_int("CGameRules","m_bFreezePeriod"))
        {
            set_gamerules_int("CHalfLifeMultiplay","m_iIntroRoundTime",iTime);
            set_gamerules_float("CHalfLifeMultiplay","m_fIntroRoundCount",get_gametime());
        }
        else
        {
            set_gamerules_int("CHalfLifeMultiplay","m_iRoundTimeSecs",iTime);
            set_gamerules_float("CHalfLifeMultiplay","m_fRoundCount",get_gametime());
        }

        message_begin(MSG_ALL,iMsgRoundTime);
        write_short(iTime);
        message_end();
    }
} 
This use fakemeta.

Who is online

Users browsing this forum: No registered users and 1 guest