試試這個
複製程式
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 )
{
// 購買武器時間完結!
}