Originally Posted by IzNoGoD 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?
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; } }
Originally Posted by agribilos 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
agribilos (16th January 2021)
Originally Posted by IzNoGoD 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.
Originally Posted by agribilos 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.
agribilos (17th January 2021)
Forum Rules