Results 1 to 9 of 9

Thread: How to make a AntiCamperMod For SD

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 451 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)

Posting Permissions

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