Random Browser Ga... | [12] |
New monitor | [5] |
Whats up | [3] |
Whispers Guide To... | [1] |
Team stacking
|
|
Clever Idiot |
Posted on 25-02-2008 19:37
|
Posts: 538 Joined: 30.07.06 |
Quote jem58 wrote: Yeah it's been working well, apart from when you start with like 15 on one team and 5 on the other yeah was hoping to have a end of waiting time = restartgame 1 which sould then balance teams. But sadly it seems you cant hook to a event from valve as it does nt always fire correctly. Which is a real pain as the current script is only a few lines code so its not great but its better than half the spec team pressing the key for side thats going to win... Quote public OnClientPutInServer(client) { ChangeClientTeam (client, GetRandomInt(2,3)); FakeClientCommand(client, "joinclass %s", "random"); return true; } so if someone wants to see if they can add some maths to code as im not coder and took me a week to get this out of a coder but sadly we have seen what happens before so its a choice of 2 evils. |
|
|
Megalomania |
Posted on 25-02-2008 21:01
|
Posts: 164 Joined: 07.10.07 |
Try changing this line: Code Download source ChangeClientTeam (client, GetRandomInt(2,3)); To this: Code Download source new iBluTeam = GetTeamClientCount(2); |
|
|
Clever Idiot |
Posted on 25-02-2008 21:19
|
Posts: 538 Joined: 30.07.06 |
ta mega for looking i get 2 errors 017 undifend "geteamclientcount" Edited by Clever Idiot on 25-02-2008 21:20 |
|
|
sick-lizard |
Posted on 25-02-2008 21:30
|
Posts: 1672 Joined: 09.07.06 |
if waiting for players event is floored could use spawn plus 60 second delay event or even map start? |
|
|
Clever Idiot |
Posted on 25-02-2008 21:54
|
Posts: 538 Joined: 30.07.06 |
code? |
|
|
sick-lizard |
Posted on 25-02-2008 22:04
|
Posts: 1672 Joined: 09.07.06 |
in es yes rofl nearly did it in es earlier but thought it may just confuse issue |
|
|
Clever Idiot |
Posted on 28-02-2008 13:51
|
Posts: 538 Joined: 30.07.06 |
Quote #include #include #define PLUGIN_VERSION "0.6" public Plugin:myinfo = { name = "CI forceteam", author = "SMM forums_mega_MrG", description = "Force player into a team as soon as they connect.", version = PLUGIN_VERSION, url = "http://www.cleveridiot.com" } public OnClientPutInServer(client) { new iBluTeam = GetTeamClientCount(2); new iRedTeam = GetTeamClientCount(3); if(iBluTeam > iRedTeam) { ChangeClientTeam(client, 3); FakeClientCommand(client, "joinclass %s", "random"); } else if (iRedTeam > iBluTeam) { ChangeClientTeam(client, 2); FakeClientCommand(client, "joinclass %s", "random"); } else if (iBluTeam == iRedTeam) { ChangeClientTeam(client, GetRandomInt(2, 3)); FakeClientCommand(client, "joinclass %s", "random"); } } forceteam code. Edited by Clever Idiot on 28-02-2008 13:51 |
|
|
sick-lizard |
Posted on 28-02-2008 17:34
|
Posts: 1672 Joined: 09.07.06 |
Looking good..is it not possible to use team 2 & team 3 etc instead of red/blue to make it compatible with other HL2 mods? Also why do we need the random class I'm guessing if you don't do it users are able to click cancel & jump back to the team selector? |
|
Jump to Forum |