PDA

View Full Version : [REQ] Scramble after X amount of won T rounds.


Kurtan
07-09-2016, 01:29
Hello!

I'd like to request a simple plugin, I know that there probably are simular plugins to what I request, however they include some features I do not want.

I'd like a plugin that would scramble the teams after X amount of won Terrorist rounds. It'd be prefered if it was read from a config file where I could alter the value of the amount of rounds required.

Feel free to ask any questions if there are any uncertainties.

Contact: Kurt (http://steamcommunity.com/id/OfficialKurt/)

Thanks in advance!

EDIT: Ended up using This (https://forums.alliedmods.net/showthread.php?t=182473) plugin instead, had to disabled all the other features.
EDIT2: This plugin was not working properly, it would scrample randomly, sometimes even a couple of rounds in a row.

Thanks for the help!

CamerDisco
07-09-2016, 07:07
#include <sourcemod>
#include <cstrike>

Handle roundCvar = INVALID_HANDLE;
Handle teamScore = INVALID_HANDLE;

public OnPluginStart()
{
roundCvar = CreateConVar("sm_sc_after_wins", "8", "after .. rounds teams will be scrambled");
HookEvent("round_end", Scramble);
AutoExecConfig(true, "plugin.scramble", "sourcemod");
}

public Action:Scramble(Handle: event , const String: name[] , bool: dontBroadcast)
{
if (CS_GetTeamScore(CS_TEAM_T) == GetConVarInt(roundCvar))
{
ServerCommand("mp_scrambleteams");
PrintToChatAll("Teams was scrambled, beacuse Terrorits won %i rounds", roundCvar);
}
}


I wrote with author this topic, It's working, but mp_scrambleteams isn't good, beacuse it's restarting game too, if someone know how to scramble teams please write it there.
I tried

for (int i=1; i<=MaxClients; i++)
{
new randomTeam = GetRandomInt( 2, 3 );
ChangeClientTeam(i, randomTeam);
}

but It chosed the same team for all.

Kurtan
07-11-2016, 12:49
I am still in need of this request, Camdisco is having some issues that he want some help with.

CowGod
07-11-2016, 14:48
would help but eh it's kurtan.

Kurtan
07-11-2016, 15:19
Cow, everyone knows that you're a scammer, you befriend community owners with "sponsorship".

Source: 1. (http://https://web.archive.org/web/20160319150044/http://doctorg.pw/2016/01/19/leaked-maps-copy-pasters-and-the-community/) 2. (https://archive.is/bVi6j)

CowGod
07-11-2016, 15:34
Kurt those are irrelevant and B2R (the 2nd post) has added me and said sorry about lying. The old owner of the community was straight delusional. I stopped hosting for them because that owner tried to take away my own access from my server box.

Kurtan
07-11-2016, 15:54
Yes because everything you say is true.

DarkDeviL
07-11-2016, 23:40
I would suggest you two to take the discussion about your hate to each other elsewhere.

If you have nothing useful to contribute with, leave the threads on AlliedModders alone.

Maxximou5
07-12-2016, 00:12
You should just use https://forums.alliedmods.net/showthread.php?t=182473 and disable the features you do not want.

Kurtan
07-12-2016, 00:20
Well, that is plan B, however, it'd be easier with a plugin for 1 feature, instead of many features disabled.

Kurtan
07-12-2016, 15:31
http://pastebin.com/JJCrSC1a

Current state of code.

Kurtan
10-10-2016, 16:06
Looking to get this fixed. Anyone feel like helping me?

Napoleon_be
10-10-2016, 16:50
What seems to be the actual problem?

Kurtan
10-10-2016, 19:57
What seems to be the actual problem?

I am getting help from a user. I can explain the current issue with this though:

1) When scramble occours, if you are a T and get scrambled to CT you will get slayed.
2) Using mp_scrambleteams which restarts the game.
3) Uneven scrambles when mp_autoteambalance is 1
4) It has occoured that a player(Bots were mostly used when testing this) is being kicked for reasons unknown

There might be other issues, it was a long time ago since I tested this particular version.