ImportBot Posted November 29, 2014 Author Share Posted November 29, 2014 Originally Posted by dyn*: I understand the overall goal, but I'm not sure I understand the details. What is the purpose of the !here command? Wouldn't it be better to spam everyone and allow an opt-out command, like !mute or !stfu? Thank you for your question and suggestions!! Trying to give a little bit of advertising to our clan members who are currently streaming to twitch that are currently playing in the game server, assuming conditions above are met (player currently running specific clan tags & in specific list). For example, not every time player dyn is in the server will he be streaming so some command needs to be available to tell the limit what the streamers current status is (streaming, or not). Player dyn (assuming he has specific clan tag and is in a custom list) upon typing !here / !stream (I changed the trigger above, my mistake) will be telling the limit that: player dyn is currently streaming and it should fire off a spam message that sends a message to the entire server notifying everyone that they're streaming live. This message is then sent out on a per-defined or pseudo random interval as to not flood the server should multiple streamers be on. The idea of a trigger to mute the spam is a good thought as well. Could add it to the list of available commands for our players to use. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted November 29, 2014 Author Share Posted November 29, 2014 Originally Posted by Level*: And you want that in plugin log or in chat?Something I mean. End of Roud works, and Next Map too Current round, not works? Can you please help me? Code: String[] factionName = new String[]{"US", "RU", "CN"}; int winTeam = (team1.RemainTickets > team2.RemainTickets) _ 1 : 2; int loseTeam = (winTeam == 1) _ 2 : 1; int winFaction = (winTeam == 1) _ team1.Faction : team2.Faction; int loseFaction = (loseTeam == 1) _ team1.Faction : team2.Faction; if((server.CurrentRound+1) > server.TotalRounds) plugin.ConsoleWrite("^b[End of Round] > ^9Round Ends with winning team " + GetTeamName + "" + factionName[(winFaction)] + ""); plugin.PRoConChat("^b[End of Round] > ^9Round Ends with winning team " + GetTeamName + "" + factionName[(winFaction)] + ""); plugin.ConsoleWrite("^b[Current round] > ^9" + (server.CurrentRound+1) + ", time in round = " + GetTimeInRoundMinutes().ToString("F0") + ", tickets = " + server.RemainTickets(winTeam).ToString("F0") + "/" + server.RemainTickets(loseTeam).ToString("F0") + "") plugin.PRoConChat("^b[Current round] > ^9" + (server.CurrentRound+1) + ", time in round = " + GetTimeInRoundMinutes().ToString("F0") + ", tickets = " + server.RemainTickets(winTeam).ToString("F0") + "/" + server.RemainTickets(loseTeam).ToString("F0") + "") plugin.ConsoleWrite("^b[Next Map] > ^9The next map is " + plugin.FriendlyMapName(server.NextMapFileName) + " " ); plugin.PRoConChat("^b[Next Map] > ^9The next map is " + plugin.FriendlyMapName(server.NextMapFileName) + " " ); return false; * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted November 29, 2014 Author Share Posted November 29, 2014 Originally Posted by vazabisong*: I want to limit XM25 to 10 kills per round if more than 10 he get kick. My problem is in the new round it still count that he already kill 10 people with XM25. What I want after 10 kills this map he get kick New map start count as 0 kill again. -------- Sorry for my english. Code: /* Version: V0.8/R1 */ String kCounter = killer.Name + "_TreatAsOne_Count"; TimeSpan time = TimeSpan.FromSeconds(5); // Activations within 5 seconds count as 1 int warnings = 0; if (server.Data.issetInt(kCounter)) warnings = server.Data.getInt(kCounter); /* The first time through, warnings is zero. Whether this is an isolated activation or the first of a sequence of activations in a short period of time, do something on this first time through. */ String msg = "none"; if (warnings == 10) { msg = plugin.R("Attention %k_n%! Do not use %w_n%! more than 15 times"); // First warning message plugin.SendGlobalMessage(msg); plugin.PRoConChat("ADMIN > " + msg); server.Data.setInt(kCounter, warnings+1); return false; } /* The second and subsequent times through, check to make sure we are not getting multiple activations in a short period of time. Ignore if less than the time span required. */ if (limit.Activations(killer.Name, time) > 1) return false; /* We get here only if there was exactly one activation in the time span */ if (warnings == 15) { msg = plugin.R("FINAL WARNING %k_n%! Do not use %w_n%!"); // Second warning message plugin.SendGlobalMessage(msg); plugin.PRoConChat("ADMIN > " + msg); } else if (warnings >= 20) { msg = plugin.R("Kicking %k_n% for ignoring warnings and killing with %w_n%! more than 20 times"); plugin.SendGlobalMessage(msg); plugin.PRoConChat("ADMIN > " + msg); plugin.PRoConEvent(msg, "Insane Limits"); plugin.KickPlayerWithMessage(killer.Name, msg); } server.Data.setInt(kCounter, warnings+1); return false; * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 1, 2014 Author Share Posted December 1, 2014 Originally Posted by avengedthedead*: Hello Sir PC9, Need you help, is there any way for insane limit to create a message for the kick when a [in game] player were randomly chosen for reserved list player [joining in]. Because alot of gamers coming back to me asking why there were kicked as there's no reason stated for the kicked. Thank you. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 1, 2014 Author Share Posted December 1, 2014 Originally Posted by PapaCharlie9*: Sorry for lack of response, guys. I've been taking time off for the holidays, no access to coding tools! When I get caught up with work again I'll come back and help you all. As a reminder to myself, I left off at post #2190. myrcon.net/...insane-limits-requests#entry27571 * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 3, 2014 Author Share Posted December 3, 2014 Originally Posted by TMiland*: Just a quick question; Is it possible to determine if a player is baseraping by: 1. If player dies x seconds after spawn x amount of times 2. Enemy must have all flags, determine ticket rate or something? 3. If the player is killed 5 times in a row, in x amount of time --> do action on the baseraper (warn/punish/kick) The idea just popped up, so i had to ask. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 6, 2014 Author Share Posted December 6, 2014 Originally Posted by PapaCharlie9*: MULTIbalancer > All: Winner was team 1 (US) MULTIbalancer > All: Map = Lost Islands, mode = Conquest Large, time in round = 00:19:47, tickets = 329/0 both would be nice Thx I'm assuming BF4, since I'm taking advantage of after-round chat. This won't work on BF3. Create a limit to evaluate OnRoundOver, call it "Round Over Stats". Set first_check to this Code: Code: String[] factionNames = new String[3]{"US", "RU", "CN"}; int winner = server.WinTeamId; int faction = server.GetFaction(winner); String teamName = "__"; if (faction >= 0 && faction <= 2) teamName = factionNames[faction]; String msg = "Winner is team " + winner + " (" + teamName + ")"; plugin.SendGlobalMessage(msg); plugin.ConsoleWrite(msg); String map = plugin.FriendlyMapName(server.MapFileName); String mode = plugin.FriendlyModeName(server.Gamemode); int hours = Convert.ToInt32(server.TimeRound/60/60); int mins = (Convert.ToInt32(server.TimeRound) / 60) % 60; int secs = (Convert.ToInt32(server.TimeRound) % 60); //Map = Lost Islands, mode = Conquest Large, time in round = 00:19:47, tickets = 329/0 <- [858] msg = "Map = " + map + ", mode = " + mode + ", time in round = " + hours.ToString("D2") + ":" + mins.ToString("D2") + ":" + secs.ToString("D2") + ", tickets = " + team1.Tickets + "/" + team2.Tickets + " [" + team1.StartTickets + "]"; plugin.SendGlobalMessage(msg); plugin.ConsoleWrite(msg); return false; * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 6, 2014 Author Share Posted December 6, 2014 Originally Posted by PapaCharlie9*: Hello Sir PC9, Need you help, is there any way for insane limit to create a message for the kick when a [in game] player were randomly chosen for reserved list player [joining in]. Because alot of gamers coming back to me asking why there were kicked as there's no reason stated for the kicked. Thank you. No, that information is not available. I don't even think a plugin gets told that a kick happened, just that a player left. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 6, 2014 Author Share Posted December 6, 2014 Originally Posted by PapaCharlie9*: Ran out of time for coding today. My internal bookmark is at post #2191. myrcon.net/...insane-limits-requests#entry27572 * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 7, 2014 Author Share Posted December 7, 2014 Originally Posted by Level*: I'm assuming BF4, since I'm taking advantage of after-round chat. This won't work on BF3. Create a limit to evaluate OnRoundOver, call it "Round Over Stats". Set first_check to this Code: Code: String[] factionNames = new String[3]{"US", "RU", "CN"}; int winner = server.WinTeamId; int faction = server.GetFaction(winner); String teamName = "__"; if (faction >= 0 && faction <= 2) teamName = factionNames[faction]; String msg = "Winner is team " + winner + " (" + teamName + ")"; plugin.SendGlobalMessage(msg); plugin.ConsoleWrite(msg); String map = plugin.FriendlyMapName(server.MapFileName); String mode = plugin.FriendlyModeName(server.Gamemode); int hours = Convert.ToInt32(server.TimeRound/60/60); int mins = (Convert.ToInt32(server.TimeRound) / 60) % 60; int secs = (Convert.ToInt32(server.TimeRound) % 60); //Map = Lost Islands, mode = Conquest Large, time in round = 00:19:47, tickets = 329/0 <- [858] msg = "Map = " + map + ", mode = " + mode + ", time in round = " + hours.ToString("D2") + ":" + mins.ToString("D2") + ":" + secs.ToString("D2") + ", tickets = " + team1.Tickets + "/" + team2.Tickets + " [" + team1.StartTickets + "]"; plugin.SendGlobalMessage(msg); plugin.ConsoleWrite(msg); return false; with the time in round something wrong, more than 30 min, it shows 01:31:25 THX * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 7, 2014 Author Share Posted December 7, 2014 Originally Posted by PapaCharlie9*: PC9, This is an edit of post #2178 with new punishments added... appears there was a little confusion, as I do not know how to use multiple quotes ...yet... Thanks for "knife only" server code you did do. Will save it for future use. ""...This Code would be for BF3 GunMaster with a little SQDM and Scavenger played also ..."" _gp? PapaCharlie9, if you have some time Had a thought for a new twist for GunMaster, make it a little harder and perhaps more interesting...(might work with other modes as well)... I run and maintain -WalkInDead- GunMaster server. Would be able to give you what ever access to it you might need. Not sure if this can be done with an Insane Limit or better as a stand alone plug-in. In time I might be able to figure out how to code it, but do not think I would do it justice. Main thought: Anytime a player is killed by a knife, would need to get a knife kill before getting a kill with any other weapon... Explanation: When player is killed by a knife, he would be added to an 'IT' list. Player would be given a YELL warning "You are 'IT'... You must get Knife Kill..." Player would remain on 'IT' list until he got a Knife Kill... If 'IT' player kills with any other weapon punishments would be ... 1st non knife kill would be admin killed with Yell warning message "You are 'IT'...knife kill needed" 2nd non knife kill would be admin killed with Yell warning "You are 'IT'...knife kill needed or be kicked" 3rd non knife kill would be round banned with message stating "You were 'IT'...knife kill was needed" When 'IT' player gets knife kill, he would be removed from 'IT' list with Yell "You are Free to Kill with All Weapons" At end of Round 'IT' list would be reset... Not sure what would be best way for this to be enabled , by vote or by admin in game... My thinking is by admin in game, so it can be shut off again if needed... The biggest draw back is this might turn server into a knife only server, but I am sure there will be players still trying to win with all weapons... _gp? Sorry for getting confused before. I'm on it now. Check out new thread here: myrcon.net/.../insane-limits-game-of-tag-youre-it-knife-kills * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 7, 2014 Author Share Posted December 7, 2014 Originally Posted by PapaCharlie9*: with the time in round something wrong, more than 30 min, it shows 01:31:25 THX Try this code instead: Code: String[] factionNames = new String[3]{"US", "RU", "CN"}; int winner = server.WinTeamId; int faction = server.GetFaction(winner); String teamName = "__"; if (faction >= 0 && faction <= 2) teamName = factionNames[faction]; String msg = "Winner is team " + winner + " (" + teamName + ")"; plugin.SendGlobalMessage(msg); plugin.ConsoleWrite(msg); String map = plugin.FriendlyMapName(server.MapFileName); String mode = plugin.FriendlyModeName(server.Gamemode); int hours = Convert.ToInt32(server.TimeRound)/60/60; int mins = (Convert.ToInt32(server.TimeRound) / 60) % 60; int secs = (Convert.ToInt32(server.TimeRound) % 60); //Map = Lost Islands, mode = Conquest Large, time in round = 00:19:47, tickets = 329/0 <- [858] msg = "Map = " + map + ", mode = " + mode + ", time in round = " + hours.ToString("D2") + ":" + mins.ToString("D2") + ":" + secs.ToString("D2") + ", tickets = " + team1.Tickets + "/" + team2.Tickets + " [" + team1.StartTickets + "]"; plugin.SendGlobalMessage(msg); plugin.ConsoleWrite(msg); return false; * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 7, 2014 Author Share Posted December 7, 2014 Originally Posted by PapaCharlie9*: Thank you for your question and suggestions!! Trying to give a little bit of advertising to our clan members who are currently streaming to twitch that are currently playing in the game server, assuming conditions above are met (player currently running specific clan tags & in specific list). For example, not every time player dyn is in the server will he be streaming so some command needs to be available to tell the limit what the streamers current status is (streaming, or not). Player dyn (assuming he has specific clan tag and is in a custom list) upon typing !here / !stream (I changed the trigger above, my mistake) will be telling the limit that: player dyn is currently streaming and it should fire off a spam message that sends a message to the entire server notifying everyone that they're streaming live. This message is then sent out on a per-defined or pseudo random interval as to not flood the server should multiple streamers be on. The idea of a trigger to mute the spam is a good thought as well. Could add it to the list of available commands for our players to use. Still need a few more details. What exactly would the spam message be and is it the same for all players who type in !here, or different? If different, that's a problem, unless the names of the players get coded into a table or something. Otherwise there's no way to know which message applies to which typer of !here. For example, if players manny, moe or jack might type !here, and each needs a custom message, I'd need code like this: Code: Dictionary<String,String> messageTable = new Dictionary<String,String>(); messageTable["manny"] = "Follow my Twitch channel MannyPwns123"; messageTable["moe"] = "Twitch live on MoeMoar1999!"; messageTable["jack"] = "Watch me t-bag manny and moe on JackMihoffer69";Whichever messages are in play will be spammed every X minutes. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 7, 2014 Author Share Posted December 7, 2014 Originally Posted by PapaCharlie9*: I want to limit XM25 to 10 kills per round if more than 10 he get kick. My problem is in the new round it still count that he already kill 10 people with XM25. What I want after 10 kills this map he get kick New map start count as 0 kill again. -------- Sorry for my english. Code: /* Version: V0.8/R1 */ String kCounter = killer.Name + "_TreatAsOne_Count"; TimeSpan time = TimeSpan.FromSeconds(5); // Activations within 5 seconds count as 1 int warnings = 0; if (server.Data.issetInt(kCounter)) warnings = server.Data.getInt(kCounter); /* The first time through, warnings is zero. Whether this is an isolated activation or the first of a sequence of activations in a short period of time, do something on this first time through. */ String msg = "none"; if (warnings == 10) { msg = plugin.R("Attention %k_n%! Do not use %w_n%! more than 15 times"); // First warning message plugin.SendGlobalMessage(msg); plugin.PRoConChat("ADMIN > " + msg); server.Data.setInt(kCounter, warnings+1); return false; } /* The second and subsequent times through, check to make sure we are not getting multiple activations in a short period of time. Ignore if less than the time span required. */ if (limit.Activations(killer.Name, time) > 1) return false; /* We get here only if there was exactly one activation in the time span */ if (warnings == 15) { msg = plugin.R("FINAL WARNING %k_n%! Do not use %w_n%!"); // Second warning message plugin.SendGlobalMessage(msg); plugin.PRoConChat("ADMIN > " + msg); } else if (warnings >= 20) { msg = plugin.R("Kicking %k_n% for ignoring warnings and killing with %w_n%! more than 20 times"); plugin.SendGlobalMessage(msg); plugin.PRoConChat("ADMIN > " + msg); plugin.PRoConEvent(msg, "Insane Limits"); plugin.KickPlayerWithMessage(killer.Name, msg); } server.Data.setInt(kCounter, warnings+1); return false; Find everywhere in the code that has .Data. and change it to .RoundData. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 7, 2014 Author Share Posted December 7, 2014 Originally Posted by PapaCharlie9*: Just a quick question; Is it possible to determine if a player is baseraping by: 1. If player dies x seconds after spawn x amount of times 2. Enemy must have all flags, determine ticket rate or something? 3. If the player is killed 5 times in a row, in x amount of time --> do action on the baseraper (warn/punish/kick) The idea just popped up, so i had to ask. 1 and 3 yes, but not 2. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 7, 2014 Author Share Posted December 7, 2014 Originally Posted by PapaCharlie9*: Okay, I think I'm caught up now, at least in this thread. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 8, 2014 Author Share Posted December 8, 2014 Originally Posted by TMiland*: 1 and 3 yes, but not 2.Nice! Is that something you would want to code? Or do i have to figure it out? * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 8, 2014 Author Share Posted December 8, 2014 Originally Posted by PapaCharlie9*: Nice! Is that something you would want to code? Or do i have to figure it out? I'll do it, but probably not until the weekend. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 9, 2014 Author Share Posted December 9, 2014 Originally Posted by TMiland*: I'll do it, but probably not until the weekend.Nice! In AdKats Col has a way to determine tickrate, is that possible to adapt for option 2 maybe? Another idea! Regarding this reddit post: http://www.reddit.com/r/battlefield_...n_battlefield/ How about setting a random vars.serverMessage with quotes from that post to teach players how to play on the loading screen? * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 10, 2014 Author Share Posted December 10, 2014 Originally Posted by PapaCharlie9*: Nice! In AdKats Col has a way to determine tickrate, is that possible to adapt for option 2 maybe? Another idea! Regarding this reddit post: http://www.reddit.com/r/battlefield_...n_battlefield/ How about setting a random vars.serverMessage with quotes from that post to teach players how to play on the loading screen? I'm pretty sure AdKats has a base rape/camp detector. Check with CCC. How random and change when? Different for each joining player or what? * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 10, 2014 Author Share Posted December 10, 2014 Originally Posted by TMiland*: I'm pretty sure AdKats has a base rape/camp detector. Check with CCC. How random and change when? Different for each joining player or what? Okay. Well, maybe set it on round end maybe, so a different line is set for each map load randomly? * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 12, 2014 Author Share Posted December 12, 2014 Originally Posted by avengedthedead*: fixed something. Code: String playerTag = player.Tag; if (String.IsNullOrEmpty(playerTag)) return false; List<PlayerInfoInterface> all = new List<PlayerInfoInterface>(); all.AddRange(team1.players); all.AddRange(team2.players); if (team3.players.Count > 0) all.AddRange(team3.players); if (team4.players.Count > 0) all.AddRange(team4.players); List<PlayerInfoInterface> clan = new List<PlayerInfoInterface>(); foreach (PlayerInfoInterface p in all) { String clanTag = p.Tag; if (String.IsNullOrEmpty(clanTag)) continue; if (clanTag != playerTag) continue; // Found a clan member! clan.Add(p); } String Counter = player.Tag + "_Count"; int current = 0; if (server.RoundData.issetInt(Counter)) current = server.RoundData.getInt(Counter); if (clan.Count > 1 && limit.Activations(player.Name) == 1 && clan.Count != current) { server.RoundData.setInt(Counter, clan.Count); String message = plugin.R ("^b ^3" + clan.Count + " [^6" + playerTag + "^3] Clan members are online ^0 ^n"); plugin.PRoConChat("ADMIN > " + message); } Hello HexaCanon, This message "Clan members are online" only display in Procon chat. How do i display in server chat visible to everyone. This is for BF4. Thanks. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 12, 2014 Author Share Posted December 12, 2014 Originally Posted by TMiland*: Hello HexaCanon, This message "Clan members are online" only display in Procon chat. How do i display in server chat visible to everyone. This is for BF4. Thanks. Try this:Code: String playerTag = player.Tag; if (String.IsNullOrEmpty(playerTag)) return false; List<PlayerInfoInterface> all = new List<PlayerInfoInterface>(); all.AddRange(team1.players); all.AddRange(team2.players); if (team3.players.Count > 0) all.AddRange(team3.players); if (team4.players.Count > 0) all.AddRange(team4.players); List<PlayerInfoInterface> clan = new List<PlayerInfoInterface>(); foreach (PlayerInfoInterface p in all) { String clanTag = p.Tag; if (String.IsNullOrEmpty(clanTag)) continue; if (clanTag != playerTag) continue; // Found a clan member! clan.Add(p); } String Counter = player.Tag + "_Count"; int current = 0; if (server.RoundData.issetInt(Counter)) current = server.RoundData.getInt(Counter); if (clan.Count > 1 && limit.Activations(player.Name) == 1 && clan.Count != current) { server.RoundData.setInt(Counter, clan.Count); String message = plugin.R ("^b ^3" + clan.Count + " [^6" + playerTag + "^3] Clan members are online ^0 ^n"); plugin.PRoConChat("ADMIN > " + message); plugin.SendGlobalMessage(message); } * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 12, 2014 Author Share Posted December 12, 2014 Originally Posted by nibiru70*: hi you can create a limit that would collect in a log all violations md5 multihack aimbot gamehack gamehook Wallack PBhack server? thanks * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 12, 2014 Author Share Posted December 12, 2014 Originally Posted by dyn*: hi you can create a limit that would collect in a log all violations md5 multihack aimbot gamehack gamehook Wallack PBhack server? thanks As a stop-gap you could try looking in your sv_viol.log or sv_cheat.log log files. Though it does seem like these log files are missing quite a few entries as I'm sure we've had people get kicked for Disallowed Driver but they're not listed in the log files... maybe a limit would be better after all? =( * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 13, 2014 Author Share Posted December 13, 2014 Originally Posted by dyn*: Still need a few more details. What exactly would the spam message be and is it the same for all players who type in !here, or different?The easiest way to maintain, program, and update would be for everyone to have the SAME message, but with their own unique name. I think this would then further allow an admin to simply update an external text file with player names for the custom list? Examples: "dyn is streaming live on Twitch" or "PapaCharlie9 is streaming live on Twitch". The names 'dyn' and PapaCharlie9' would be separate entries in a custom list. This message could then be sent every X minutes for a max of Y minutes, until the streamer types the 'stop' command, or leaves the server. One item not sure how to address would be to ensure that, for example, if there are multiple streamers in the same server that all messages (5, for instance) would not be sent at the same time. Thanks again for your consideration, PC9. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 13, 2014 Author Share Posted December 13, 2014 Originally Posted by PapaCharlie9*: Okay. Well, maybe set it on round end maybe, so a different line is set for each map load randomly? Easy! Assuming you can set vars.serverMessage outside of startup.txt ... have you tried it? Create a new limit to evaluate OnRoundOver, call it "Tips for noobs". Set first_check to this Code: Code: List<String> tips = new List<String>(); tips.Add("PTFO = Play The F-ing Objective!"); tips.Add("Watch your corners!"); tips.Add("Kill all the nearby enemies before rezing your squad mate."); // Add more here // Pick the next tip String key = "index for tips"; int i = 0; if (!plugin.Data.issetInt(key)) { Random r = new Random(); i = r.Next(tips.Count); } else { i = plugin.Data.getInt(key); } i = (i + 1) % tips.Count; plugin.Data.setInt(key, i); // Set it plugin.SendGlobalMessage("TIP: " + tips[i]); plugin.ServerCommand("vars.serverMessage", tips[i]); return false; * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 13, 2014 Author Share Posted December 13, 2014 Originally Posted by PapaCharlie9*: The easiest way to maintain, program, and update would be for everyone to have the SAME message, but with their own unique name. I think this would then further allow an admin to simply update an external text file with player names for the custom list? Examples: "dyn is streaming live on Twitch" or "PapaCharlie9 is streaming live on Twitch". The names 'dyn' and PapaCharlie9' would be separate entries in a custom list. This message could then be sent every X minutes for a max of Y minutes, until the streamer types the 'stop' command, or leaves the server. One item not sure how to address would be to ensure that, for example, if there are multiple streamers in the same server that all messages (5, for instance) would not be sent at the same time. Thanks again for your consideration, PC9. Hmmm. How many people are we talking about? It might be better to just have separate limits for each person. I'll just do one generic limit, but you can duplicate that to be specific to a player by changing first_check to this: Code: (player.Name == "xxx")Then the rest of the limit only applies to the player with that name, and make one for each player. I'll make sure the messages are at least 1 minute apart, that's not a problem. You'll need at least two limits, one to spamming the messages on a timer, the other for the command. Spammer Create a limit to evaluate OnServerInterval, set the interval to 60 seconds, call it "Twitch spammer". Set first_check to this Code: Code: double MinutesBetweenSpams = 10; // CHANGE String key = "Twitcher"; List<PlayerInfoInterface> all = new List<PlayerInfoInterface>(); all.AddRange(team1.players); all.AddRange(team2.players); foreach (PlayerInfoInterface twitcher in all) { if (!twitcher.Data.issetObject(key)) continue; DateTime last = (DateTime)twitcher.Data.getObject(key); if (DateTime.Now.Subtract(last).TotalMinutes >= MinutesBetweenSpams) { // reset timer twitcher.Data.setObject(key, (object)DateTime.Now); // Send message plugin.SendGlobalMessage(twitcher.Data.getString(key)); // Bail out now to make sure two spam messages don't happen back to back return false; } } return false; Message and player command (Generic) Create a limit to evaluate OnAnyChat, call it "Twitch commander". This is the one you would duplicate if you want to do it per player. Set first_check to this Expression (change for per player): Code: (true)Set second_check to this Code: Code: if (!Regex.Match(player.LastChat, @"(!here|!stream)", RegexOptions.IgnoreCase).Success) return false; if (!plugin.isInList(player.Name, "twitchers")) { plugin.SendPlayerMessage(player.Name, "You are not allowed to use that command!"); return false; } String key = "Twitcher"; player.Data.setString(key, player.Name + ": Generic message goes here"); // CHANGE player.Data.setObject(key, (object)DateTime.Now); // Send initial message plugin.SendGlobalMessage(player.Data.getString(key)); return false;Notice the that items with // CHANGE are stuff you should edit to customize. IMPORTANT: The value of MinutesBetweenSpams should be AT LEAST twice the maximum total number of simultaneous twitchers. Otherwise, some messages might get lost. I have set the default to 10, so the maximum number of simultaneous twitchers that can use that value without change is 5. If you have 6, you need to set it to at least 12, etc. EDIT: I forgot to add the custom list. Create a custom list called "twitchers", CaseSensitive, and fill with the list of player names allowed to use the command, separated by commas. * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 14, 2014 Author Share Posted December 14, 2014 Originally Posted by TMiland*: Easy! Assuming you can set vars.serverMessage outside of startup.txt ... have you tried it? Create a new limit to evaluate OnRoundOver, call it "Tips for noobs". Set first_check to this Code: Code: List<String> tips = new List<String>(); tips.Add("PTFO = Play The F-ing Objective!"); tips.Add("Watch your corners!"); tips.Add("Kill all the nearby enemies before rezing your squad mate."); // Add more here // Pick the next tip String key = "index for tips"; int i = 0; if (!plugin.Data.issetInt(key)) { Random r = new Random(); i = r.Next(tips.Count); } else { i = plugin.Data.getInt(key); } i = (i + 1) % tips.Count; plugin.Data.setInt(key, i); // Set it plugin.SendGlobalMessage("TIP: " + tips[i]); plugin.ServerCommand("vars.serverMessage", tips[i]); return false; Thank you! I'll add and test it right away. Edit: Works! Here's the full version: Code: /* Create a new limit to evaluate OnRoundOver, call it "Tips for noobs". Set first_check to this Code: */ List<String> tips = new List<String>(); tips.Add("Hitting a Tank straight on with a flat 90° angle rocket will do more damage than a regular hit to the side!"); tips.Add("Hold down <key> to charge the defibrillator, you will earn more points and revive allies with more health!"); tips.Add("When suppressed it becomes harder to aim as firing your weapon is less accurate"); tips.Add("Mortars are great for taking out people who are sitting still, use them to takeout gunners and snipers!"); tips.Add("The PLD and SOFLAM allow your entire team to preform a powerful Top-Down Lock-on attack with launchers!"); tips.Add("Flags on the battlefield provide your team with powerful war assets like Tanks and Cruise Missiles, Capture them!"); tips.Add("You can disarm an MCOM by using the EOD bot, It's what they're designed for soldier!"); tips.Add("Suppressing your weapon will prevent you from appearing on the map when you shoot, but reduces your hip-fire accuracy"); tips.Add("Laser sights will shine through the smoke and reveal where you are if you point it at someone, Turn it off with <Key>"); tips.Add("After firing the SRAW, quickly let go of ADS to prevent it from aiming off target if you happen to die"); // Add more here // Pick the next tip String key = "index for tips"; int i = 0; if (!plugin.Data.issetInt(key)) { Random r = new Random(); i = r.Next(tips.Count); } else { i = plugin.Data.getInt(key); } i = (i + 1) % tips.Count; plugin.Data.setInt(key, i); // Set it plugin.SendGlobalMessage("TIP: " + tips[i]); plugin.ServerCommand("vars.serverMessage", tips[i]); return false; * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted December 14, 2014 Author Share Posted December 14, 2014 Originally Posted by w262035635*: HI,PapaCharlie9 I am searching a plug-in.. Player spawn after, check battlelog loadout. If this weapon is limit, the player will be kill. This is how to do? Can you help me? * Restored post. It could be that the author is no longer active. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.