试试这个
复制程式
new mp_buytime
new Float:m_flRoundCount
public plugin_init()
{
register_event( "HLTV", "Event_HLTV_NewRound", "a", "1=0", "2=0" )
Event_HLTV_NewRound()
mp_buytime = get_cvar_pointer( "mp_buytime" )
}
public Event_HLTV_NewRound()
{
m_flRoundCount = get_gametime()
}
然后到你的MENU加上这句检查
复制程式
if( floatround( get_pcvar_float( mp_buytime ) * 60.0 ) < get_gametime() - m_flRoundCount )
{
// 购买武器时间完结!
}