Page 3 of 3 FirstFirst 123
Results 21 to 27 of 27

Thread: Replicating the binoculars bug?

  1. #21
    Private First Class
    Join Date
    Oct 2013
    Posts
    219
    Thanks
    56
    Thanked 105 Times in 66 Posts
    Quote Originally Posted by serthy View Post
    You need to add a chatterbot, too :-)
    Haha yeah, thats taking it abit far xD

  2. #22
    Private
    Join Date
    Apr 2020
    Posts
    66
    Thanks
    28
    Thanked 14 Times in 13 Posts
    Quote Originally Posted by IzNoGoD View Post
    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
    Silly question but where do you need to put this function in order to get it working?

  3. #23
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Quote Originally Posted by agribilos View Post
    Silly question but where do you need to put this function in order to get it working?
    Better to just hijack the follownext/followprev stuff in-engine.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  4. The Following User Says Thank You to IzNoGoD For This Useful Post:

    agribilos (16th January 2021)

  5. #24
    Private
    Join Date
    Apr 2020
    Posts
    66
    Thanks
    28
    Thanked 14 Times in 13 Posts
    Quote Originally Posted by IzNoGoD View Post
    Better to just hijack the follownext/followprev stuff in-engine.
    And how is that done? Do i have to modify the libcod source and recompile? Please guide me in the right direction.

  6. #25
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Quote Originally Posted by agribilos View Post
    And how is that done? Do i have to modify the libcod source and recompile? Please guide me in the right direction.
    look if the follownext/followprev stuff shows up in the clientcommand callback, if so, hijack it properly.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  7. The Following User Says Thank You to IzNoGoD For This Useful Post:

    agribilos (17th January 2021)

  8. #26
    Private
    Join Date
    Apr 2020
    Posts
    66
    Thanks
    28
    Thanked 14 Times in 13 Posts
    Didn't have any luck finding clientcommand callback. Is it somewhere in the stock gsc files or in libcod?

    Edit:
    https://script.cod2.ru/libcod/player/clientcommand.htm
    This is the one i guess but i don't know where the follownext/followprev stuff is.
    Last edited by agribilos; 17th January 2021 at 09:03.

  9. #27
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    You can read the clientcommand callback documentation here: https://killtube.org/showthread.php?...r-Builtin-B3!)

    Note: fixChatArgs is no longer required (because it is included with libcod since this thread)
    Last edited by Mitch; 17th January 2021 at 16:18.

  10. The Following User Says Thank You to Mitch For This Useful Post:

    agribilos (17th January 2021)

Posting Permissions

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