Jump to content

Insane Limits: Yell to Squad Members on Request (AMMO, MEDIC, ORDER...)


ImportBot

Recommended Posts

Originally Posted by TMiland*:

 

Since you can't be 100% sure that the method will not return null, you need to test and offer an alternative message if it is null. E.g.:

Code:

String slName = plugin.GetSquadLeaderName(player.TeamId, player.SquadId);
if (slName != null)
{
    MessageType5.Add(": What's the objective " + slName + "_");
}
else
{
    MessageType5.Add(": What's the objective_");
}
Thank you LCARSx64! This is working great!! :cool:

 

Code:

String slName = plugin.GetSquadLeaderName(player.TeamId, player.SquadId);
if (slName != null)
{
	MessageType5.Add(": What's the objective " + slName + "_");
	MessageType5.Add(": Objective" + slName + "_");
	MessageType5.Add(": What's the ORDERS " + slName + "_");
}
else
{
	MessageType5.Add(": What's the objective_");
	MessageType5.Add(": What's the objective Squad Leader_");
	MessageType5.Add(": Objective Squad Leader_");
	MessageType5.Add(": What's the ORDERS_");
}
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

Thank you LCARSx64! This is working great!! :cool:

 

Code:

String slName = plugin.GetSquadLeaderName(player.TeamId, player.SquadId);
if (slName != null)
{
	MessageType5.Add(": What's the objective " + slName + "_");
	MessageType5.Add(": Objective" + slName + "_");
	MessageType5.Add(": What's the ORDERS " + slName + "_");
}
else
{
	MessageType5.Add(": What's the objective_");
	MessageType5.Add(": What's the objective Squad Leader_");
	MessageType5.Add(": Objective Squad Leader_");
	MessageType5.Add(": What's the ORDERS_");
}
Ugh. While that code will work (if it is in the context of the OP, that is, recreating the list on each OnAnyChat event, per player), it's not particularly efficient and makes my fingers twitch with wanting to fix the whole thing.

 

But I'll limit myself to just one improvement. Well, two. Store the name in a variable and only do the test once and use @ in front of the string, removing the need for escapes, not that single quotes need escaping in the first place:

 

Code:

String slName = plugin.GetSquadLeaderName(player.TeamId, player.SquadId);
if (slName == null)
    slName = "Squad Leader";
MessageType5.Add(@": What's the objective, " + slName + "_");
MessageType5.Add(@": Objective, " + slName + "_");
MessageType5.Add(@": What's the ORDERS, " + slName + "_");
MessageType5.Add(@": What are your ORDERS, " + slName + "_");
MessageType5.Add(@": Tell me what ima do, " + slName + "_");
MessageType5.Add(@": I be noob! You tell me what do, " + slName + "!");
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by TMiland*:

 

Ugh. While that code will work (if it is in the context of the OP, that is, recreating the list on each OnAnyChat event, per player), it's not particularly efficient and makes my fingers twitch with wanting to fix the whole thing.

 

But I'll limit myself to just one improvement. Well, two. Store the name in a variable and only do the test once and use @ in front of the string, removing the need for escapes, not that single quotes need escaping in the first place:

 

Code:

String slName = plugin.GetSquadLeaderName(player.TeamId, player.SquadId);
if (slName == null)
    slName = "Squad Leader";
MessageType5.Add(@": What's the objective, " + slName + "_");
MessageType5.Add(@": Objective, " + slName + "_");
MessageType5.Add(@": What's the ORDERS, " + slName + "_");
MessageType5.Add(@": What are your ORDERS, " + slName + "_");
MessageType5.Add(@": Tell me what ima do, " + slName + "_");
MessageType5.Add(@": I be noob! You tell me what do, " + slName + "!");
Thanks PC9, i'll clean it up in the morning! :-)

 

Edit:

 

Here's the cleaned up version:

Code:

if (!player.LastChat.StartsWith("ID_CHAT_"))
    return false;

string msg;
List<string> MessageType1 = new List<string>();
List<string> MessageType2 = new List<string>();
List<string> MessageType3 = new List<string>();
List<string> MessageType4 = new List<string>();
List<string> MessageType5 = new List<string>();
List<string> MessageType6 = new List<string>();
List<string> MessageType7 = new List<string>();
List<string> MessageType8 = new List<string>();
List<string> MessageType9 = new List<string>();
List<string> MessageType10 = new List<string>();
List<string> MessageType11 = new List<string>();
List<string> MessageType12 = new List<string>();
List<string> MessageType13 = new List<string>();
Random rnd = new Random();

// Add all your messages which should be shown on "ID_CHAT_ATTACK/DEFEND" request
MessageType1.Add(@" gave you an ORDER Soldier! PTFO!");
MessageType1.Add(@" PTFO To win the round Soldier!");
MessageType1.Add(@" has marked the OBJECTIVE! PTFO!");
MessageType1.Add(@": Attack/Defend the marked OBJECTIVE Soldier");

// Add all your messages which should be shown on "ID_CHAT_THANKS" request
MessageType2.Add(@": Thank You!");
MessageType2.Add(@": Thanks Man!");
MessageType2.Add(@": Hey, Thanks A Lot!");
MessageType2.Add(@": Thank You Soldier!");
MessageType2.Add(@": Thanks Man, I Owe You One!");
MessageType2.Add(@": Thanks Soldier!");
MessageType2.Add(@": Alright, Thanks A lot Man!");
MessageType2.Add(@": Thank You Man!");
MessageType2.Add(@": That's Great, Thanks!");
MessageType2.Add(@": Hey, Thanks A Lot!");
MessageType2.Add(@": Thanks Dude!");
MessageType2.Add(@": Sweet, Thanks Man!");
MessageType2.Add(@": Thanks, I Appreciate It!");
MessageType2.Add(@": Thanks A Lot!");
MessageType2.Add(@": Alright, Thanks A lot!");
MessageType2.Add(@": Thank You Bro!");
MessageType2.Add(@": Hey, I Really Appreciate It!");
MessageType2.Add(@": Damn, Thanks A Lot!");
MessageType2.Add(@": Hey, I Owe You One!");
MessageType2.Add(@": Thanks Man, Alright!");

// Add all your messages which should be shown on "ID_CHAT_SORRY" request
MessageType3.Add(@": My Bad!");
MessageType3.Add(@": Oh Fuck, My Bad Man!");
MessageType3.Add(@": Sorry Man, I Fucked Up!");
MessageType3.Add(@": Uh, My Mistake!");
MessageType3.Add(@": Oh Fuck, Sorry About That!");
MessageType3.Add(@": I Didn't Mean To Fuck That One Up!");
MessageType3.Add(@": Sorry Man, My Bad!");
MessageType3.Add(@": Aw, Fuck Me, That Was My Fault!");
MessageType3.Add(@": Fuck Man, I Am Sorry!");
MessageType3.Add(@": Aw Shit, Sorry!");
MessageType3.Add(@": Shit, That Was My Bad!");
MessageType3.Add(@": That Was My Fault!");
MessageType3.Add(@": Yeah I Fucked That One Up, Sorry Man!");
MessageType3.Add(@": Sorry My Bad, I Fucked Up!");
MessageType3.Add(@": My Bad!");
MessageType3.Add(@": That Was My Fault, Sorry!");
MessageType3.Add(@": Sorry, Man That Was My Fault!");
MessageType3.Add(@": That Was My Fault Man, Sorry!");
MessageType3.Add(@": Thats On Me, I Am Sorry Man!");
MessageType3.Add(@": Aw Fuck, I Am Sorry Man!");
MessageType3.Add(@": Hey, I Am Sorry!");
MessageType3.Add(@": My Fault!");
MessageType3.Add(@": Sorry Bro!");
MessageType3.Add(@": Wow, Sorry Dude!");
MessageType3.Add(@": Sorry Man, I Fucked Up!");
MessageType3.Add(@": Hey! Sorry About That!");
MessageType3.Add(@": Jeez, Sorry About That!");
MessageType3.Add(@": Aw Fuck, Sorry, My Fault!");
MessageType3.Add(@": Sorry Dude!");
MessageType3.Add(@": Sorry About That, Won't Happen Again!");
MessageType3.Add(@": Sorry!");
MessageType3.Add(@": I am so Sorry!");
MessageType3.Add(@": Sorry About That!");
MessageType3.Add(@": Oh Crap!");

// Add all your messages which should be shown on "ID_CHAT_GOGOGO" request
MessageType4.Add(@": Hey Grab Your Shit, Let's Go!");
MessageType4.Add(@": Playtime Is Over, Get Out!");
MessageType4.Add(@": Grab Your Shit, We're Steppin!");
MessageType4.Add(@": We're Steppin!");
MessageType4.Add(@": GO!");
MessageType4.Add(@": Go Now!");
MessageType4.Add(@": Let's Go! GO!!");
MessageType4.Add(@": Come On, Let's Go");
MessageType4.Add(@": Let's Go!");
MessageType4.Add(@": Let's Move! Move! Move!");
MessageType4.Add(@": Come On, GO!!");
MessageType4.Add(@": Go, NOW!!");
MessageType4.Add(@": We are Steppin!");
MessageType4.Add(@": Let's Move, GO!!");
MessageType4.Add(@": Go, Let's Move Out!");
MessageType4.Add(@": Mooooooove!!!");
MessageType4.Add(@": Knees High, Step It UP, Go! Go!");
MessageType4.Add(@": Move Your Asses, Let's Go!");
MessageType4.Add(@": Alright, Let's Get Fucking Moving!");
MessageType4.Add(@": Move Out, You Motherfukkas!");
MessageType4.Add(@": It's Time To Haul Ass!");
MessageType4.Add(@": Alright, We gotta Move Now!");
MessageType4.Add(@": We Are Moving Out!");
MessageType4.Add(@": Go! Go! Go!");
MessageType4.Add(@": Let's get out of here!");
MessageType4.Add(@": Let's get down to business!");

// Add all your messages which should be shown on "ID_CHAT_REQUEST_ORDER" request
String slName = plugin.GetSquadLeaderName(player.TeamId, player.SquadId);
if (slName == null)
    slName = "Squad Leader";
	MessageType5.Add(@": What's the objective, " + slName + "_");
	MessageType5.Add(@": Objective, " + slName + "_");
	MessageType5.Add(@": What's the ORDERS, " + slName + "_");
	MessageType5.Add(@": What are your ORDERS, " + slName + "_");
	MessageType5.Add(@": Tell me what to do, " + slName + "_");
	MessageType5.Add(@": I'm a noob! You tell me what do, " + slName + "!");
// Add all your messages which should be shown on "ID_CHAT_REQUEST_MEDIC" request
MessageType6.Add(@" requested a MEDIC! Throw out a bag!");
MessageType6.Add(@" Is DYING! Give him some MEDICINE");
MessageType6.Add(@": I Need a MEDIC!");
MessageType6.Add(@": Where Is The Got Damn MEDIC_");
MessageType6.Add(@": Get Me A Medic Over Here!");
MessageType6.Add(@": Get Me A Medic!!");
MessageType6.Add(@": I Need A Fucking Medic NOW!");
MessageType6.Add(@": Get Me A Fucking Medic!");
MessageType6.Add(@": MEDIIIIIC!!");
MessageType6.Add(@": Aw, Hell, I Need A Medic Over Here!");
MessageType6.Add(@": I Am Dying Out Here, I Need A Medic!");
MessageType6.Add(@": Oh Jesus, I Need A Medic!");
MessageType6.Add(@": Oh God, I Need A Medic!");
MessageType6.Add(@": I Need A Medic!");
MessageType6.Add(@": Bleeding All Over The Place, MEEDIC!");
MessageType6.Add(@": Give Me A Fucking Medic!");
MessageType6.Add(@": I Need A Medic Here, NOW!");
MessageType6.Add(@": I NEED A MEDIC!!");

// Add all your messages which should be shown on "ID_CHAT_REQUEST_AMMO" request
MessageType7.Add(@": Anybody Got Any ROUNDS_");
MessageType7.Add(@": I Need Some Bullets Over Here!");
MessageType7.Add(@": AMMO!! AMMO!!");
MessageType7.Add(@": Somebody Hook Me Up With Some AMMO!");
MessageType7.Add(@": Hey, Give Me Some AMMO!");
MessageType7.Add(@": Toss Me Over Some ROUNDS!");
MessageType7.Add(@": Hook Me Up With Some ROUNDS!");
MessageType7.Add(@": I Need Some AMMO!");
MessageType7.Add(@": I Need Some AMMO Over Here!");
MessageType7.Add(@": I Need Some AMMO Over Here, Someone Help Me Out!");
MessageType7.Add(@" requested AMMO! Throw out a bag!");
MessageType7.Add(@" Is out of AMMO! Give it to him!");

// Add all your messages which should be shown on "ID_CHAT_REQUEST_RIDE" request
MessageType8.Add(@" requested a RIDE! Go pick him up!");
MessageType8.Add(@" needs a RIDE, be a teammate and pick him up!");
MessageType8.Add(@": I Need A Ride!");
MessageType8.Add(@": Hey, Come Over Here And Pick Me Up!");
MessageType8.Add(@": Hey, I Need A Ride Here!");
MessageType8.Add(@": Hey, Someone Come Get Me!");
MessageType8.Add(@": I Need A Ride!");
MessageType8.Add(@": Someone Come Pick Me Up!");
MessageType8.Add(@": I Really Need A Ride Over Here!");
MessageType8.Add(@": Someone Come Get Me, I Need A Ride!");
MessageType8.Add(@": Someone Come Get Me!");
MessageType8.Add(@": Someone Send Me A Fucking Vehicle!");
MessageType8.Add(@": Hey, Come And Get Me!");
MessageType8.Add(@": Come Get My Ass Outta Here!");
MessageType8.Add(@": I Need A Fucking Lift!");
MessageType8.Add(@": Hey, I Need A Ride!");
MessageType8.Add(@": Need A Pickup Over Here!");
MessageType8.Add(@": I Need A Lift Here!");
MessageType8.Add(@": Come Get My Ass!");
MessageType8.Add(@": Come And Get Me, I Need To Get The Fuck Outta Here!");
MessageType8.Add(@": Can i get a RIDE_");

// Add all your messages which should be shown on "ID_CHAT_GET_OUT" request
MessageType9.Add(@": Hop Out, Let's Move!");
MessageType9.Add(@": Let's Move People!");
MessageType9.Add(@": Let's Move Out Guys, Go! Go!");
MessageType9.Add(@": Alright, Let's Bail!");
MessageType9.Add(@": Alright, Let's Move On Out!");
MessageType9.Add(@": Alright, Out Of The Vehicle!");
MessageType9.Add(@": Alright Boys, Let's Move!");
MessageType9.Add(@": Get Out Of The Vehicle Now!");
MessageType9.Add(@": Alright, Let's Get Outta Here!");
MessageType9.Add(@": We are Steppin, Move! Move!");
MessageType9.Add(@": Move! Move! Move!");
MessageType9.Add(@": Bail Out, Let's Move!");
MessageType9.Add(@": Get Out, We are Moving!");
MessageType9.Add(@" requested a SPOT! Get out of the vehicle!");
MessageType9.Add(@" Is probably playing with a teammate, GTFO!");

// Add all your messages which should be shown on "ID_CHAT_GET_IN" request
MessageType10.Add(@": Hey, Hop In!");
MessageType10.Add(@": Come On, Get In!");
MessageType10.Add(@": Get In, Let's Go!");
MessageType10.Add(@": Steppin out, Come On, Let's Go!");
MessageType10.Add(@": Alright, We Are Moving Out, Get In!");
MessageType10.Add(@": Get In, Let's Move Out!");
MessageType10.Add(@": Get You Ass In, Let's Roll!");
MessageType10.Add(@": Get In Here Soldier, We Gotta Go!");
MessageType10.Add(@": Come On, Let's Go!");
MessageType10.Add(@": We Aint Got Time To Fuck Around, Let's Go!");
MessageType10.Add(@": Come On We Gotta Move!");
MessageType10.Add(@": Get Your Ass In Here, We Gotta Go!");
MessageType10.Add(@": Get In, We Gotta Go!");
MessageType10.Add(@": Alright, Get The Fuck In Here, We Gotta Move!");
MessageType10.Add(@": Alright, Hop In, Let's Get Outta Here!");
MessageType10.Add(@": Hey Man, Get In, Let's Go!");
MessageType10.Add(@" has a free SPOT! Get in the vehicle!");
MessageType10.Add(@" said: Do you need a lift_");

// Add all your messages which should be shown on "ID_CHAT_REQUEST_REPAIRS" request
MessageType11.Add(@" This Shit Aint Running No More, I Need To Get It Fixed!");
MessageType11.Add(@" I Need A Mechanic!");
MessageType11.Add(@" Someone Get Over Here And Get This Shit Running!");
MessageType11.Add(@" I Need Somebody To Fix My Vehicle!");
MessageType11.Add(@" My Vehicle Is Fucked, I Need Some Help!");
MessageType11.Add(@" Come On, I Need A Mechanic Over Here!");
MessageType11.Add(@" Oh Fuck, My Ride Is Out, I Need Somebody To Fix It!");
MessageType11.Add(@" Oh, I Fucked Up My Ride, I Need Some Repairs!");
MessageType11.Add(@" This Ride Needs Repairs!");
MessageType11.Add(@" This Peace Of Shit Cant Move, I Need A Got Damn Mechanic!");
MessageType11.Add(@" Hey, Come Fix Up My Ride!");
MessageType11.Add(@" In Desperate Need Of A Mechanic Over Here!");
MessageType11.Add(@" My Vehicle Is Fucked Up, Can Anybody Help Me_");
MessageType11.Add(@" I Need Mechanical Assistance!");
MessageType11.Add(@" Fuck, I Need A Mechanic here!");
MessageType11.Add(@" I Need Some Help To Fix This Shit!");
MessageType11.Add(@" I Need A GreaseMonkey To Take A Look At This Shit!");
MessageType11.Add(@" requested REPAIRS! Now! Go! Go! Go!");
MessageType11.Add(@" Has a damaged vehicle, go REPAIR your teammate!");

// Add all your messages which should be shown on "ID_CHAT_AFFIRMATIVE" request
MessageType12.Add(@": Affirmative!");
MessageType12.Add(@": Copy That!");
MessageType12.Add(@": Okay Chief!");
MessageType12.Add(@": Roger That!");
MessageType12.Add(@": Sure Thing!");
MessageType12.Add(@": No Problem!");
MessageType12.Add(@": Yeah, You betcha!");
MessageType12.Add(@": Yes!");
MessageType12.Add(@": Consider It Done!");
MessageType12.Add(@": Yeah, No Sweat!");
MessageType12.Add(@": Alright, No Problem!");
MessageType12.Add(@": I'll Get Right On That!");
MessageType12.Add(@": Thats Affirmative!");

// Add all your messages which should be shown on "ID_CHAT_NEGATIVE" request
MessageType13.Add(@" NO! I cannot do that!");
MessageType13.Add(@" Maybe later!");
MessageType13.Add(@" I'll Get Back To It!");
MessageType13.Add(@" No can do!");
MessageType13.Add(@" Thats a NEGATIVE!");
MessageType13.Add(@" NO!");
MessageType13.Add(@" Uh, thats not possible at this time!");
MessageType13.Add(@" No way man!");
MessageType13.Add(@" I am all tied up, i cannot do that right now!");
MessageType13.Add(@" Sorry, No!");
MessageType13.Add(@" No, Sorry!");
MessageType13.Add(@" Negative! Cannot do that right now!");
MessageType13.Add(@" Yeah, i dont think so!");
/* 

All other messages should also be defined here

*/
	
	switch (player.LastChat)
	{
		case "ID_CHAT_ATTACK/DEFEND":
		{
			msg = player.Name + MessageType1[rnd.Next(MessageType1.Count)]; // Take a random message from Message Type 1
		}	break;
		case "ID_CHAT_THANKS":
		{
			msg = player.Name + MessageType2[rnd.Next(MessageType2.Count)]; // Take a random message from Message Type 2
		}	break;
		case "ID_CHAT_SORRY":
		{
			msg = player.Name + MessageType3[rnd.Next(MessageType3.Count)]; // Take a random message from Message Type 3
		}	break;
		case "ID_CHAT_GOGOGO":
		{
			msg = player.Name + MessageType4[rnd.Next(MessageType4.Count)]; // Take a random message from Message Type 4
		}	break;
		case "ID_CHAT_REQUEST_ORDER":
		{
			msg = player.Name + MessageType5[rnd.Next(MessageType5.Count)]; // Take a random message from Message Type 5
		}	break;
		case "ID_CHAT_REQUEST_MEDIC":
		{
			msg = player.Name + MessageType6[rnd.Next(MessageType6.Count)]; // Take a random message from Message Type 6
		}	break;
		case "ID_CHAT_REQUEST_AMMO":
		{
			msg = player.Name + MessageType7[rnd.Next(MessageType7.Count)]; // Take a random message from Message Type 7
		}	break;
		case "ID_CHAT_REQUEST_RIDE":
		{
			msg = player.Name + MessageType8[rnd.Next(MessageType8.Count)]; // Take a random message from Message Type 8
		}	break;
		case "ID_CHAT_GET_OUT":
		{
			msg = player.Name + MessageType9[rnd.Next(MessageType9.Count)]; // Take a random message from Message Type 9
		}	break;
		case "ID_CHAT_GET_IN":
		{
			msg = player.Name + MessageType10[rnd.Next(MessageType10.Count)]; // Take a random message from Message Type 10
		}	break;
		case "ID_CHAT_REQUEST_REPAIRS":
		{
			msg = player.Name + MessageType11[rnd.Next(MessageType11.Count)]; // Take a random message from Message Type 11
		}	break;
		case "ID_CHAT_AFFIRMATIVE":
		{
			msg = player.Name + MessageType12[rnd.Next(MessageType12.Count)]; // Take a random message from Message Type 12
		}	break;
		case "ID_CHAT_NEGATIVE":
		{
			msg = player.Name + MessageType13[rnd.Next(MessageType13.Count)]; // Take a random message from Message Type 13
		}	break;
        default:
        plugin.ConsoleWrite("Unknown commo rose chat code: " + player.LastChat);
        return false;
	}
	// We need a list for notification
List<PlayerInfoInterface> callersTeam = new List<PlayerInfoInterface>();

// Get a list of players on caller's team
	switch (player.TeamId)
	{
		case 1:
		{
			callersTeam.AddRange(team1.players);
		}	break;
		case 2:
		{
			callersTeam.AddRange(team2.players);
		}	break;
		case 3:
		{
			callersTeam.AddRange(team3.players);
		}	break;
		case 4:
		{	callersTeam.AddRange(team4.players);
			break;
		}
	}
	if (!player.Data.issetBool("NoYell"))
	{
		player.Data.setBool("NoYell", true);
	}
	// Send the message only to the players in the same squad
	foreach (PlayerInfoInterface p in callersTeam)
	{
		if ((p.Name != player.Name) && (p.SquadId == player.SquadId))
		{
			plugin.SendPlayerYell(p.Name, msg, 5);
		}
	}
	if (player.Data.getBool("NoYell"))
	{
		// Send msg to squad chat if @noyell is off
		plugin.SendSquadMessage(player.TeamId, player.SquadId, msg);
	}
	// For writing to console
	plugin.ConsoleWrite("^b^1ADMIN ORDERS >^0^n " + msg);
	// For writing to chat
	//plugin.PRoConChat("^b^1ADMIN ORDERS >^0^n " + msg);
	plugin.PRoConEvent(msg, "Insane Limits");

	return false;
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

Why is there no screenshots or videos how it looks?

When a player chooses an in-game commo rose message, it repeats the message in the chat box.

 

For instance, if you select "Go, Go, Go" in the commo rose at the beginning of the round, not only will your player yell that message audibly in the game, the player's message will also be "yelled" in text form across his squad mate's screen. I am not sure what kind of additional information or demonstrations you could need.

* Restored post. It could be that the author is no longer active.
Link to comment
  • 4 weeks later...

Originally Posted by 397Seth*:

 

Hi,

 

is there a way to stop the procon spam: [19:59:04 76] [insane Limits] Unknown commo rose chat code: ID_CHAT_GOGOGO

 

I tried removing the default but then I get an empty admin message.

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by TMiland*:

 

Hi,

 

is there a way to stop the procon spam: [19:59:04 76] [insane Limits] Unknown commo rose chat code: ID_CHAT_GOGOGO

 

I tried removing the default but then I get an empty admin message.

Did you remove Code:
default:
from the code?
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by PapaCharlie9*:

 

@397Seth, post all of the code you are using. I suspect you started with post #23, which left some stuff out that you need to fill in.

 

Post it in

 markup tags.

			
		
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by 397Seth*:

 

Hi,

 

here's the code:

 

Code:

string msg = "none";

if (!player.LastChat.StartsWith("ID_CHAT_"))
    return false;

	switch (player.LastChat)
	{
		case "ID_CHAT_REQUEST_ORDER":
		{
			msg = player.Name + " requested ORDERS! Help him out!";
		}	break;
		case "ID_CHAT_REQUEST_MEDIC":
		{
			msg = player.Name + " requested a MEDIC! Help him out!";
		}	break;
		case "ID_CHAT_REQUEST_AMMO":
		{
			msg = player.Name + " requested AMMO! Help him out!";
		}	break;
		case "ID_CHAT_REQUEST_RIDE":
		{
			msg = player.Name + " requested a RIDE! Help him out!";
		}	break;
		case "ID_CHAT_REQUEST_REPAIRS":
		{
			msg = player.Name + " requested REPAIRS! Help him out!";
		}	break;		
       
 default:
        plugin.ConsoleWrite("Unknown commo rose chat code: " + player.LastChat);


        return false;
	}
	// We need a list for notification
List<PlayerInfoInterface> callersTeam = new List<PlayerInfoInterface>();

// Get a list of players on caller's team
	switch (player.TeamId)
	{
		case 1:
		{
			callersTeam.AddRange(team1.players);
		}	break;
		case 2:
		{
			callersTeam.AddRange(team2.players);
		}	break;
		case 3:
		{
			callersTeam.AddRange(team3.players);
		}	break;
		case 4:
		{	callersTeam.AddRange(team4.players);
			break;
		}
	}
	// Send the message only to the players in the same squad
	foreach (PlayerInfoInterface p in callersTeam)
	{
		if ((p.Name != player.Name) && (p.SquadId == player.SquadId))
		{
			plugin.SendPlayerYell(p.Name, msg, 5);
		}
	}
	// Send msg to squad chat in addition to Yell
	plugin.SendSquadMessage(player.TeamId, player.SquadId, msg);
return false;
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by LCARSx64*:

 

Change the code to this (also, you don't need the curly brackets {} after each case):

Code:

string msg = "none";

if (!player.LastChat.StartsWith("ID_CHAT_"))
    return false;

switch (player.LastChat)
{
case "ID_CHAT_REQUEST_ORDER":
msg = player.Name + " requested ORDERS! Help him out!";
break;
case "ID_CHAT_REQUEST_MEDIC":
msg = player.Name + " requested a MEDIC! Help him out!";
break;
case "ID_CHAT_REQUEST_AMMO":
msg = player.Name + " requested AMMO! Help him out!";
break;
case "ID_CHAT_REQUEST_RIDE":
msg = player.Name + " requested a RIDE! Help him out!";
break;
case "ID_CHAT_REQUEST_REPAIRS":
msg = player.Name + " requested REPAIRS! Help him out!";
break;
default:
        return false;
        break;
}
// We need a list for notification
List<PlayerInfoInterface> callersTeam = new List<PlayerInfoInterface>();

// Get a list of players on caller's team
switch (player.TeamId)
{
case 1:
callersTeam.AddRange(team1.players);
break;
case 2:
callersTeam.AddRange(team2.players);
break;
case 3:
callersTeam.AddRange(team3.players);
break;
case 4:
callersTeam.AddRange(team4.players);
break;
}
// Send the message only to the players in the same squad
foreach (PlayerInfoInterface p in callersTeam)
{
if ((p.Name != player.Name) && (p.SquadId == player.SquadId))
{
plugin.SendPlayerYell(p.Name, msg, 5);
}
}
// Send msg to squad chat in addition to Yell
plugin.SendSquadMessage(player.TeamId, player.SquadId, msg);
return false;
Sent from Samsung Galaxy S5 using Tapatalk
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by 397Seth*:

 

I get the following error message:

[11:18:01 77] [insane Limits] Thread(settings): ERROR: 3 errors compiling Code

[11:18:01 77] [insane Limits] Thread(settings): ERROR: (CS0305, line: 54, column: 13): Using the generic type 'System.Collections.Generic.List' requires '1' type arguments

[11:18:01 77] [insane Limits] Thread(settings): ERROR: (CS0305, line: 54, column: 36): Using the generic type 'System.Collections.Generic.List' requires '1' type arguments

[11:18:01 77] [insane Limits] Thread(settings): ERROR: (CS1579, line: 73, column: 13): foreach statement cannot operate on variables of type 'List' because 'List' does not contain a public definition for 'GetEnumerator'

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by LCARSx64*:

 

I get the following error message:

[11:18:01 77] [insane Limits] Thread(settings): ERROR: 3 errors compiling Code

[11:18:01 77] [insane Limits] Thread(settings): ERROR: (CS0305, line: 54, column: 13): Using the generic type 'System.Collections.Generic.List' requires '1' type arguments

[11:18:01 77] [insane Limits] Thread(settings): ERROR: (CS0305, line: 54, column: 36): Using the generic type 'System.Collections.Generic.List' requires '1' type arguments

[11:18:01 77] [insane Limits] Thread(settings): ERROR: (CS1579, line: 73, column: 13): foreach statement cannot operate on variables of type 'List' because 'List' does not contain a public definition for 'GetEnumerator'

Sorry about that, I just made minor changes to the code you posted, that had an error in it. I've fixed that error in my previous post. :ohmy:
* Restored post. It could be that the author is no longer active.
Link to comment
  • 10 months later...

Originally Posted by Vancer2*:

 

I have set this up using the first code. However. When I am ingame it will take up 4 lines of chat if someone requests a medic. It doesn't keep it in squad chat. How do I fix this? Here is the code.

 

Code:

string msg = "none";

if (!player.LastChat.StartsWith("ID_CHAT_"))
    return false;

	switch (player.LastChat)
	{
		case "ID_CHAT_ATTACK/DEFEND":
		{
			msg = player.Name + " Gave you an ORDER! Follow up!";
		}	break;
		case "ID_CHAT_THANKS":
		{
			msg = player.Name + " says: THANK YOU!";
		}	break;
		case "ID_CHAT_SORRY":
		{
			msg = player.Name + " says: SORRY!";
		}	break;
		case "ID_CHAT_GOGOGO":
		{
			msg = player.Name + " said Let's Go!";
		}	break;
		case "ID_CHAT_REQUEST_ORDER":
		{
			msg = player.Name + " requested ORDERS!";
		}	break;
		case "ID_CHAT_REQUEST_MEDIC":
		{
			msg = player.Name + " requested a MEDIC!";
		}	break;
		case "ID_CHAT_REQUEST_AMMO":
		{
			msg = player.Name + " requested AMMO!";
		}	break;
		case "ID_CHAT_REQUEST_RIDE":
		{
			msg = player.Name + " requested a RIDE!";
		}	break;
		case "ID_CHAT_GET_OUT":
		{
			msg = player.Name + " requested a SPOT!";
		}	break;
		case "ID_CHAT_GET_IN":
		{
			msg = player.Name + " has a free SPOT!";
		}	break;
		case "ID_CHAT_REQUEST_REPAIRS":
		{
			msg = player.Name + " requested REPAIRS!";
		}	break;
		case "ID_CHAT_AFFIRMATIVE":
		{
			msg = player.Name + " accepted REQUEST!";
		}	break;
		case "ID_CHAT_NEGATIVE":
		{
			msg = player.Name + " denied REQUEST!";
		}	break;
        default:
        plugin.ConsoleWrite("Unknown commo rose chat code: " + player.LastChat);
        return false;
	}
	// We need a list for notification
List<PlayerInfoInterface> callersTeam = new List<PlayerInfoInterface>();

// Get a list of players on caller's team
	switch (player.TeamId)
	{
		case 1:
		{
			callersTeam.AddRange(team1.players);
		}	break;
		case 2:
		{
			callersTeam.AddRange(team2.players);
		}	break;
		case 3:
		{
			callersTeam.AddRange(team3.players);
		}	break;
		case 4:
		{	callersTeam.AddRange(team4.players);
			break;
		}
	}
	if (!player.Data.issetBool("NoYell"))
	{
		player.Data.setBool("NoYell", true);
	}
	// Send the message only to the players in the same squad
	foreach (PlayerInfoInterface p in callersTeam)
		if (player.Data.getBool("NoYell"))
	{
		// Send msg to squad chat if @noyell is off
		plugin.SendSquadMessage(player.TeamId, player.SquadId, msg);
	}
	// For writing to console
	plugin.ConsoleWrite("^b^1ADMIN ORDERS >^0^n " + msg);
	// For writing to chat
	//plugin.PRoConChat("^b^1ADMIN ORDERS >^0^n " + msg);
	plugin.PRoConEvent(msg, "Insane Limits");

	return false;
* Restored post. It could be that the author is no longer active.
Link to comment

Archived

This topic is now archived and is closed to further replies.



  • Our picks

    • Game Server Hosting:

      We're happy to announce that EZRCON will branch out into the game server provider scene. This is a big step for us so please having patience if something doesn't go right in this area. Now, what makes us different compared to other providers? Well, we're going with the idea of having a scaleable server hosting and providing more control in how you set up your server. For example, in Minecraft, you have the ability to control how many CPU cores you wish your server to have access to, how much RAM you want to use, how much disk space you want to use. This type of control can't be offered in a single service package so you're able to configure a custom package the way you want it.

      You can see all the available games here. Currently, we have the following games available.

      Valheim (From $1.50 USD)


      Rust (From $3.20 USD)


      Minecraft (Basic) (From $4.00 USD)


      Call of Duty 4X (From $7.00 USD)


      OpenTTD (From $4.00 USD)


      Squad (From $9.00 USD)


      Insurgency: Sandstorm (From $6.40 USD)


      Changes to US-East:

      Starting in January 2022, we will be moving to a different provider that has better support, better infrastructure, and better connectivity. We've noticed that the connection/routes to this location are not ideal and it's been hard getting support to correct this. Our contract for our two servers ends in March/April respectively. If you currently have servers in this location you will be migrated over to the new provider. We'll have more details when the time comes closer to January. The new location for this change will be based out of Atlanta, GA. If you have any questions/concerns please open a ticket and we'll do our best to answer them.
      • 5 replies
    • Hello All,

      I wanted to give an update to how EZRCON is doing. As of today we have 56 active customers using the services offered. I'm glad its doing so well and it hasn't been 1 year yet. To those that have services with EZRCON, I hope the service is doing well and if not please let us know so that we can improve it where possible. We've done quite a few changes behind the scenes to improve the performance hopefully. 

      We'll be launching a new location for hosting procon layers in either Los Angeles, USA or Chicago, IL. Still being decided on where the placement should be but these two locations are not set in stone yet. We would like to get feedback on where we should have a new location for hosting the Procon Layers, which you can do by replying to this topic. A poll will be created where people can vote on which location they would like to see.

      We're also looking for some suggestions on what else you would like to see for hosting provider options. So please let us know your thoughts on this matter.
      • 4 replies
    • Added ability to disable the new API check for player country info


      Updated GeoIP database file


      Removed usage sending stats


      Added EZRCON ad banner



      If you are upgrading then you may need to add these two lines to your existing installation in the file procon.cfg. To enable these options just change False to True.

      procon.private.options.UseGeoIpFileOnly False
      procon.private.options.BlockRssFeedNews False



       
      • 2 replies
    • I wanted I let you know that I am starting to build out the foundation for the hosting services that I talked about here. The pricing model I was originally going for wasn't going to be suitable for how I want to build it. So instead I decided to offer each service as it's own product instead of a package deal. In the future, hopefully, I will be able to do this and offer discounts to those that choose it.

      Here is how the pricing is laid out for each service as well as information about each. This is as of 7/12/2020.

      Single MySQL database (up to 30 GB) is $10 USD per month.



      If you go over the 30 GB usage for the database then each additional gigabyte is charged at $0.10 USD each billing cycle. If you're under 30GB you don't need to worry about this.


      Databases are replicated across 3 zones (regions) for redundancy. One (1) on the east coast of the USA, One (1) in Frankfurt, and One (1) in Singapore. Depending on the demand, this would grow to more regions.


      Databases will also be backed up daily and retained for 7 days.




      Procon Layer will be $2 USD per month.


      Each layer will only allow one (1) game server connection. The reason behind this is for performance.


      Each layer will also come with all available plugins installed by default. This is to help facilitate faster deployments and get you up and running quickly.


      Each layer will automatically restart if Procon crashes. 


      Each layer will also automatically restart daily at midnight to make sure it stays in tip-top shape.


      Custom plugins can be installed by submitting a support ticket.




      Battlefield Admin Control Panel (BFACP) will be $5 USD per month


      As I am still working on building version 3 of the software, I will be installing the last version I did. Once I complete version 3 it will automatically be upgraded for you.





      All these services will be managed by me so you don't have to worry about the technical side of things to get up and going.

      If you would like to see how much it would cost for the services, I made a calculator that you can use. It can be found here https://ezrcon.com/calculator.html

       
      • 11 replies
    • I have pushed out a new minor release which updates the geodata pull (flags in the playerlisting). This should be way more accurate now. As always, please let me know if any problems show up.

       
      • 9 replies
×
×
  • Create New...

Important Information

Please review our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.