Results 1 to 10 of 27

Thread: Replicating the binoculars bug?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #10
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Ok, that wasnt "today". Here is script anyway:
    Code:
    preventbotspec()
    {
    	while(true)
    	{
    		if(isdefined(self.pers["team"]) && self.pers["team"] == "spectator")
    		{
    			cl = self getspectatorclient();
    			if(isdefined(cl) && cl != self)
    			{
    				if(cl.isbot)
    				{
    					players = getentarray("player", "classname");
    					found = false;
    					tospec = -1;
    					for(i = 0; i < players.size; i++)
    					{
    						if(players[i] == self)
    							continue;
    						if(tospec == -1 && !players[i].isbot)
    							tospec = players[i] getentitynumber();
    						if(!found)
    						{
    							if(players[i] == cl)
    								found = true;
    						}
    						else if(!players[i].isbot)
    						{
    							tospec = i;
    							break;
    						}
    					}
    					self.spectatorclient = tospec;
    				}
    			}
    		}
    		wait .05;
    	}
    }
    requires libcod, untested code
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

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

    filthy_freak_ (3rd May 2014),kung foo man (3rd May 2014)

Posting Permissions

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