AddThinkToEnt(self,null) setpropstring <- NetProps.SetPropString.bindenv(NetProps) getpropfloat <- NetProps.GetPropFloat.bindenv(NetProps) setpropfloat <- NetProps.SetPropFloat.bindenv(NetProps) addtimeent <- Entities.FindByName(null,"addtime") settimeent <- Entities.FindByName(null,"settime") ptime <- null stime <- null stimeadd <- null timeroffset <- 10*60 timercolor <- "0 255 255" function timer(min,sec,x,y,color) { EntFireByHandle(self,"addoutput","color "+color,-1,null,null) EntFireByHandle(self,"addoutput","x "+x,-1,null,null) EntFireByHandle(self,"addoutput","y "+y,-1,null,null) timercolor = color timeroffset = min*60+sec stime = Time()+timeroffset+1 stimeadd = stime } function AddThinkToSelf(string) { stime = Time()+timeroffset+1 stimeadd = stime AddThinkToEnt(self,string) } function timerthink() { local ftime = Time() local ctime = stime-ftime local addTime = getpropfloat(addtimeent,"m_flInValue") if(addTime!=0) { if(stimeadd==stime) stimeadd+=addTime EntFireByHandle(self,"addoutput","color 0 255 0",-1,null,null) stime+=(addTime/66) if((addTime>0&&stimeadd<=stime)||(addTime<0&&stimeadd>=stime)) { stimeadd=stime setpropfloat(addtimeent,"m_flInValue",0) EntFireByHandle(self,"addoutput","color "+timercolor,-1,null,null) } } local setTime = getpropfloat(settimeent,"m_flInValue") if(setTime!=0) { timer(0,setTime) EntFireByHandle(self,"addoutput","color 255 255 0",-1,null,null) EntFireByHandle(self,"addoutput","color "+timercolor,0.33,null,null) setpropfloat(settimeent,"m_flInValue",0) } if(ctime<=0) { setpropstring(self,"m_iszScriptThinkFunction","") EntFire("bots_win_red","roundwin") } local seconds = ctime%60 local o="" if(seconds<10)o="0" setpropstring(self,"m_iszMessage",format("%i:%s%i",ctime/60,o,seconds)) EntFireByHandle(self,"display","",-1,null,null) return -1 } function timerpausethink() { local pause = stime-ptime local seconds = pause%60 local o="" if(seconds<10)o="0" setpropstring(self,"m_iszMessage",format("%i:%s%i",pause/60,o,seconds)) EntFireByHandle(self,"display","",-1,null,null) return -1 } function timerpause() { if(ptime) { stime+=(Time()-ptime) stimeadd=stime ptime = null AddThinkToEnt(self,"timerthink") } else { AddThinkToEnt(self,"timerpausethink") ptime = Time() } EntFireByHandle(self,"display","",-1,null,null) }