Results 1 to 9 of 9

Thread: How to make a AntiCamperMod For SD

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    Code:
    antiCamp()
    {
    	self endon("killed_player");
    
    	count = 0;
    	time = 15;
    
    	for(;;)
    	{
    		origin = self.origin;
    
    		wait 1;
    
    		if(self.origin == origin)
    			count++;
    		else
    			count = 0;
    
    		if(count == time)
    			self suicide();
    	}	
    }
    For standalone
    Code:
    init()
    {
    	thread onPlayerConnect();
    }
    
    onPlayerConnect()
    {
    	level endon("intermission");
    
    	for(;;)
    	{
    		level waittill("connecting", player);
    		player thread onPlayerSpawned();
    	}
    }
    
    onPlayerSpawned()
    {
    	self endon("disconnect");
    	level endon("intermission");
    
    	for(;;)
    	{
    		self waittill("spawned_player");
    		self thread antiCamp();
    	}
    }
    Last edited by Mitch; 31st January 2013 at 20:57.

  2. The Following 2 Users Say Thank You to Mitch For This Useful Post:

    kung foo man (31st January 2013),STAUFFi (31st January 2013)

  3. #2
    Sergeant EvoloZz's Avatar
    Join Date
    Sep 2012
    Location
    Helsinki, Finland
    Posts
    360
    Thanks
    314
    Thanked 167 Times in 120 Posts
    Quote Originally Posted by Mitch View Post
    Code:
    antiCamp()
    {
    	self endon("killed_player");
    
    	count = 0;
    	time = 15;
    
    	for(;;)
    	{
    		origin = self.origin;
    
    		wait 1;
    
    		if(self.origin == origin)
    			count++;
    		else
    			count = 0;
    
    		if(count == time)
    			self suicide();
    	}	
    }
    For standalone
    Code:
    init()
    {
    	thread onPlayerConnect();
    }
    
    onPlayerConnect()
    {
    	level endon("intermission");
    
    	for(;;)
    	{
    		level waittill("connecting", player);
    		player thread onPlayerSpawned();
    	}
    }
    
    onPlayerSpawned()
    {
    	self endon("disconnect");
    	level endon("intermission");
    
    	for(;;)
    	{
    		self waittill("spawned_player");
    		self thread antiCamp();
    	}
    }
    With something like that you die immediately after spawn, at least I do

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •