[Release] [MP] Anti Hardscope code snippet

Topic created · 2 Posts · 81 Views
  • did this earlier for a friend so might as well share here

    call this once on player (I do mine onplayerspawned):

    self thread monitorads();
    

    then put this somewhere in your code:

    monitorads()
    {
    	self endon("disconnect");
    	level endon("game_ended");
    
    	adstime = 0;
    
    	for(;;)
    	{
    		if (self playerAds() == 1) {
    			adstime++;
    		} else if (self playerAds() == 0 && adstime != 0) {
    			adstime = 0;
    		}
    
    		// to change time, do (second divided by 0.05)
    		// ex: 0.5 seconds divided by 0.05 = 10
    		if (adstime == 10)
    		{
    			adstime = 0;
    			self allowads(false);
    			while (self playerAds() != 0) {
    				wait 0.05;
    			}
    			self allowads(true);
    		}
    		wait 0.05;
    	}
    }
    
  • @mikey Nice release dude!

Log in to reply