ImportBot Posted March 9, 2016 Author Share Posted March 9, 2016 Originally Posted by ColColonCleaner*: I want to use this to setup a whitelist for idle kick.....how do I do this what are the settings specifically? I'm new to insane limitsWhich game? There is a mandatory idle kick in BF4 after 5 minutes that cannot be disabled. Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted March 28, 2016 Author Share Posted March 28, 2016 Originally Posted by Gijzijtdood*: Hi all, Is it possible to trigger a limit from within another plugin? Kind regards Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 3, 2016 Author Share Posted April 3, 2016 Originally Posted by fahaed120*: thankss Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 3, 2016 Author Share Posted April 3, 2016 Originally Posted by sammad143*: // Limit Player's KDR & Rank double maxKDR = 2; // Maximum KD, anyone with higher is kicked double maxRank = 140; // Maximum Rank, anyone with higher is kicked String[] msgs = { "Sorry, your ", " is higher than ", "KDR", "Rank" }; if (player.Kdr > maxKDR || player.Rank > maxRank) { String kMsg = msgs[0]; if (player.Kdr > maxKDR) { kMsg = kMsg + msgs[2] + msgs[1] + maxKDR.ToString("F1"); } else { kMsg = kMsg + msgs[3] + msgs[1] + maxRank.ToString(); } plugin.KickPlayerWithMessage(player.Name, kMsg); } return false; How do I add a clan TAG whitelist in the above code, for example I want no K/D , rank restrictions on players with XYZ and ABC clan tags in battlelog. Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 3, 2016 Author Share Posted April 3, 2016 Originally Posted by Grovax*: @sammad143: First activate Whitelists at Insane Limits, for that set use_white_list to true and then add ur clantags or playernames to the whitelists Code: // Limit Player's KDR & Rank double maxKDR = 2; // Maximum KD, anyone with higher is kicked double maxRank = 140; // Maximum Rank, anyone with higher is kicked //Whitelist if (plugin.isInWhitelist(player.Name)) return false; String[] msgs = {"Sorry, your "," is higher than ","KDR","Rank"}; if (player.Kdr > maxKDR || player.Rank > maxRank) { String kMsg = msgs[0]; if (player.Kdr > maxKDR) { kMsg = kMsg + msgs[2] + msgs[1] + maxKDR.ToString("F1"); } else { kMsg = kMsg + msgs[3] + msgs[1] + maxRank.ToString(); } plugin.KickPlayerWithMessage(player.Name, kMsg); } return false; Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 12, 2016 Author Share Posted April 12, 2016 Originally Posted by virusdead*: a result of "player.CountryName" I would have wanted to visit the player added numbers that it connects to the server plugin.SendGlobalMessage("Welcome to " + player.Name + " from " + player.CountryName + "."); return false; Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 14, 2016 Author Share Posted April 14, 2016 Originally Posted by BuRockK*: Hello, im trying to test OnTeamChange event in IL but i want action to be taken only on first teamchange and if requirements are not met. Example: I have set some ClanTags to a custom list which will be the allowed clans list. When a player joins server and finishes loading map, players team state changes from Neutral to lets say US Army. Which mean the player finished loading map and entered the game. Now im not familiar with IL. What would be the code in something like this: Code: if (!plugin.isInList(player.Name, JRWhitelist) | !plugin.isInList(player.Tag, JRAllowedClans)) { }EDIT: i added some coding accourding to what ive read in details of the plugin Code: String JRWhitelist = "JRWhitelist"; String JRAllowedClans = "JRAllowedClans"; String JRState = "strValue"; if (!plugin.isInList(player.Name, JRWhitelist) | !plugin.isInList(player.Tag, JRAllowedClans)) { return true; }So now it doesnt give those 2 errors shown in attachment. Also im not sure if String JRState = "strValue"; is correct in order for me to use it with an in-game command to change its state from "on" to "off" or vice versa. Attached Files: IL_SS.png Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 14, 2016 Author Share Posted April 14, 2016 Originally Posted by ColColonCleaner*: Hello, im trying to test OnTeamChange event in IL but i want action to be taken only on first teamchange and if requirements are not met. Example: I have set some ClanTags to a custom list which will be the allowed clans list. When a player joins server and finishes loading map, players team state changes from Neutral to lets say US Army. Which mean the player finished loading map and entered the game. Now im not familiar with IL. What would be the code in something like this: Code: if (!plugin.isInList(player.Name, JRWhitelist) | !plugin.isInList(player.Tag, JRAllowedClans)) { }Heres the setup i have in IL:If you continue to have issues with this in PR or IL, there is a banned clan tag feature in AdKats. Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 14, 2016 Author Share Posted April 14, 2016 Originally Posted by BuRockK*: If you continue to have issues with this in PR or IL, there is a banned clan tag feature in AdKats.Oh im just trying to test if OnTeamChange would work on a just joined player, as i explained above. If the Neutral team state of a player can be used in an OnTeamChange it would be very nice. But i dont know IL so i was trying to figure out the coding part. BTW i updated my post above. Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 15, 2016 Author Share Posted April 15, 2016 Originally Posted by s1ngular1ty*: Oh im just trying to test if OnTeamChange would work on a just joined player, as i explained above. If the Neutral team state of a player can be used in an OnTeamChange it would be very nice. But i dont know IL so i was trying to figure out the coding part. BTW i updated my post above. Read entire post before trying this code... Set evaluation to OnTeamChange Set first_check to Expression Set first_check expression to: Code: (plugin.isInList(player.Tag, "clan_list") && !plugin.isInList(player.Name, "white_list"))Set action to Kick Set kick_message to: Code: kick_message = %p_n%, your clan [%p_ct%] is not welcomed here!Create two custom lists. clan_list white_list Set clan_list comparison to CaseSensitive Add clan tags to it's data variable like this: TEST, TEST2, ETC Set white_list comparison to CaseSensitive Add names of players you want white listed to it's data variable like this: Player1, Player2, Player3 This code will run on any team change event and should catch the team change event of a player that just joined the server. It shouldn't matter it if runs every time someone changes teams. So don't focus on trying to prevent it running all the time. Keep it simple. Insane Limits is almost like writing a custom plugin. You can do a lot with it. It takes normal C# code as arguments to limit checks. Edit: Instead of creating your own custom white_list you can use the built in InsaneLimits white lists by changing the first_check expression to this: Code: (plugin.isInList(player.Tag, "clan_list") && !player.isInWhitelist)Also you need to enable white lists in Insane Limits up at the top part of the variables section. Then you can enter clans tags or players you want to white list in the Whitelist section of the plugin variables. The first_check expression will check a boolean flag for the player that is set by InsaneLimits if they are in either white list. The expression reads like, if the player's tag is in "clan_list" and the player is NOT in an InsaneLimits white list then do something to them. Edit: Bad news... Looks like InsaneLimits suppresses the 1st move that occurs when a player joins. So this isn't going to work. Also looks like InsaneLimits doesn't process the OnTeamChange event at all for BF4. Sorry..... Final Edit: I tried using the OnJoin event and it seems like it would work but I remember this failing in the past. From the debug logs it appears it fires after the player is updated from BattleLog but I didn't have many joining. If more players joined it could delay a player's updates and cause the check to fail because the Battlelog info was not there yet. You can try the above code using OnJoin instead of OnTeamChange and see if it works. I'm doubting it will be reliable. Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 15, 2016 Author Share Posted April 15, 2016 Originally Posted by BuRockK*: Well, if its not working for OnTeamChange, there goes another theory down. I wanted to test if we could somehow use Neutral team state for a player if that player has just joined server and currently loading map. But i will still try anyway just for the sake of learning Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 15, 2016 Author Share Posted April 15, 2016 Originally Posted by ColColonCleaner*: Well, if its not working for OnTeamChange, there goes another theory down. I wanted to test if we could somehow use Neutral team state for a player if that player has just joined server and currently loading map. But i will still try anyway just for the sake of learning What about it doesn't work? Can't you just check for when they go from neutral to a real team and ignore the other cases? Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 15, 2016 Author Share Posted April 15, 2016 Originally Posted by s1ngular1ty*: What about it doesn't work? Can't you just check for when they go from neutral to a real team and ignore the other cases? The OnTeamChange event never fires in BF4 as far as I can tell. I setup a simple limit to test it that would log every time it fires. It never did. Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 15, 2016 Author Share Posted April 15, 2016 Originally Posted by ColColonCleaner*: The OnTeamChange event never fires as far as I can tell. I setup a simple limit to test it that would log every time it fires. It never did.Huh, maybe it itself intentionally ignores that particular move so people writing team change limits don't get confused by their limit firing on joining players. Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 15, 2016 Author Share Posted April 15, 2016 Originally Posted by BuRockK*: What about it doesn't work? Can't you just check for when they go from neutral to a real team and ignore the other cases? Umm, yea... thats what i actually was trying to do but since you know i suck at C sharp i cant set a Limit in IL on that to begin with.. Heres how i would do in ProconRulz if on teamchange was supported.. On TeamChange;PlayerFirst;if %ini_whitelist_%p%% 1;kick %p% "joins restricted" Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 15, 2016 Author Share Posted April 15, 2016 Originally Posted by s1ngular1ty*: Huh, maybe it itself intentionally ignores that particular move so people writing team change limits don't get confused by their limit firing on joining players.The event never fired even when I manually changed my team. Seems like it is broken for BF4 or something. Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 15, 2016 Author Share Posted April 15, 2016 Originally Posted by s1ngular1ty*: Huh, maybe it itself intentionally ignores that particular move so people writing team change limits don't get confused by their limit firing on joining players. I have a feeling you didn't read my entire post. The code I posted will probably work some of the time using OnJoin instead of OnTeamChange. You can test its reliability, but it will work at least some of the time. Try it and see what happens. The code for the limit is exactly the same. You could use the same code with OnSpawn if you wanted as well. Using OnSpawn will definitely work. Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 15, 2016 Author Share Posted April 15, 2016 Originally Posted by BuRockK*: Okay i dont know how you guys couldnt manage to kick on join for whatever reason but i was able to make it work every time i tested it Heres the setup i have.. i just used "(!player.isInWhitelist)" expression for the first_check Now all i need is how to make a bool var in that limit and use it in a OnAnyChat limit so admins can turn it on or off. Also would like to know if theres a way to list or add/delete entries to the built-in whitelist of IL with an ingame command Attached Files: IL_JRSetup.png Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 15, 2016 Author Share Posted April 15, 2016 Originally Posted by s1ngular1ty*: Okay i dont know how you guys couldnt manage to kick on join for whatever reason but i was able to make it work every time i tested it Heres the setup i have.. i just used "(!player.isInWhitelist)" expression for the first_check Now all i need is how to make a bool var in that limit and use it in a OnAnyChat limit so admins can turn it on or off. Also would like to know if theres a way to list or add/delete entries to the built-in whitelist of IL with an ingame command Don't claim success if you haven't had many joining yet. If you are whitelisting based on clan Tag you could have problems if lots join your server and it takes longer to update their clan tag from BattleLog. If you are just testing on 1 player joining your server it will probably always works. However, adding more players joining can cause delays which can cause the check to fail. PapaCharlie even says there are situations where limits don't evaluate during player stat updates because that is just how InsaneLimits works and to fix would be a major rewrite. I hope it works out for you though. Way easier than writing your own plugin. Also I noticed a couple things in your screenshot. You have the limit state set to virtual, it should be set to enabled. Secondly, why do you have a Kick and EABAN action? You can just use the EABAN action by itself. It will kick the player and ban them temporarily. Having both doesn't buy you anything. Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 15, 2016 Author Share Posted April 15, 2016 Originally Posted by BuRockK*: Don't claim success if you haven't had many joining yet. If you are whitelisting based on clan Tag you could have problems if lots join your server and it takes longer to update their clan tag from BattleLog. If you are just testing on 1 player joining your server it will probably always works. However, adding more players joining can cause delays which can cause the check to fail. PapaCharlie even says there are situations where limits don't evaluate during player stat updates because that is just how InsaneLimits works and to fix would be a major rewrite. I hope it works out for you though. Way easier than writing your own plugin. Also I noticed a couple things in your screenshot. You have the limit state set to virtual, it should be set to enabled. Secondly, why do you have a Kick and EABAN action? You can just use the EABAN action by itself. It will kick the player and ban them temporarily. Having both doesn't buy you anything. I suspect problems when having multiple joins at around same time. For now it works. Maybe keeping players in queue for a bit longer would work? i dont know. Yea i had it virtual when i was testing. Also it was a mistake using EABan with having kick. it was disconnecting procon from layer for some reason so i took EABan off. So having this same limit as an onSpawn would be much better in a server where lots of players joining more frequently? what is the difference between an onJoin and onSpawn if in both events players are being queued for actions? Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 15, 2016 Author Share Posted April 15, 2016 Originally Posted by s1ngular1ty*: I suspect problems when having multiple joins at around same time. For now it works. Maybe keeping players in queue for a bit longer would work? i dont know. Yea i had it virtual when i was testing. Also it was a mistake using EABan with having kick. it was disconnecting procon from layer for some reason so i took EABan off. So having this same limit as an onSpawn would be much better in a server where lots of players joining more frequently? what is the difference between an onJoin and onSpawn if in both events players are being queued for actions? Yes, using OnSpawn ALWAYS works. I've been trying to tell you this for several days. Just use OnSpawn. The OnSpawn event fires at a different time than OnJoin. If you want a temp ban you can use EABAN (by itself) which will kick + temp ban the player for some period of time so they don't come right back. Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 15, 2016 Author Share Posted April 15, 2016 Originally Posted by BuRockK*: Yes, using OnSpawn ALWAYS works. I've been trying to tell you this for several days. Just use OnSpawn. The OnSpawn event fires at a different time than OnJoin. If you want a temp ban you can use EABAN (by itself) which will kick + temp ban the player for some period of time so they don't come right back. Yea i know man, i was just being eager to get onjoin to work with different logics. So wouldnt it be the same thing if alotta people spawn more frequently just like it would be in an onJoin? im just trying to understand why it wouldnt work for onjoin because it seems IL dont act until the player finishes loading map and actually joins game. After THAT limit queues the player for the action (fetches battlelog info, checks if player triggers limit or not etc.). Maybe its a DICE thing to be fixed? Also IL could make a stats list for players like it could save battlelog stats of every player joined the server at least once and have it there until server restarts or shutdown. So it wouldnt take too long to get fetch stats for joining player and limit can act more quicker. Just an idea. not sure if it would work with IL's structure or anything Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 15, 2016 Author Share Posted April 15, 2016 Originally Posted by s1ngular1ty*: Yea i know man, i was just being eager to get onjoin to work with different logics. So wouldnt it be the same thing if alotta people spawn more frequently just like it would be in an onJoin? im just trying to understand why it wouldnt work for onjoin because it seems IL dont act until the player finishes loading map and actually joins game. After THAT limit queues the player for the action (fetches battlelog info, checks if player triggers limit or not etc.). Maybe its a DICE thing to be fixed?I told you why. The OnSpawn event fires at a later time which is usually after the player's stats have been updated. OnJoin can fire before they even show up in the Player List. You can watch this happen if you raise the debug level to 6. You will see when events are triggered. There will be messages in the plugin log window. From my experience trying this same thing, OnSpawn always works and OnJoin doesn't always work. Feel free to prove me wrong if you want. I'm just trying to help you. Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 15, 2016 Author Share Posted April 15, 2016 Originally Posted by BuRockK*: I told you why. The OnSpawn event fires at a later time which is usually after the player's stats have been updated. OnJoin can fire before they even show up in the Player List. You can watch this happen if you raise the debug level to 6. You will see when events are triggered. From my experience trying this same thing, OnSpawn always works and OnJoin doesn't always work. Feel free to prove me wrong if you want. I'm just trying to help you. Yea i know, i edited my post about this while you were typing. Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 15, 2016 Author Share Posted April 15, 2016 Originally Posted by s1ngular1ty*: Yea i know, i edited my post about this while you were typing.BattleLog info is not fectched for every limit. That would not be wise and would make way too many requests and would be too slow. The info is updated once when a player joins and kept in memory and refreshed at the start of new rounds if the player stays. Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 15, 2016 Author Share Posted April 15, 2016 Originally Posted by BuRockK*: BattleLog info is not fectched for every limit. That would not be wise and would make way too many requests and would be too slow. The info is updated once when a player joins and kept in memory and refreshed at the start of new rounds if the player stays.Yea thats what i meant kindda. Info is kept in memory or in a log for that matter and stay there but no info of any player is deleted until a server restart so those infos can be used whenever a player joins the server again some other time. Would be a big ass list maybe but would work? Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 16, 2016 Author Share Posted April 16, 2016 Originally Posted by s1ngular1ty*: Yea thats what i meant kindda. Info is kept in memory or in a log for that matter and stay there but no info of any player is deleted until a server restart so those infos can be used whenever a player joins the server again some other time. Would be a big ass list maybe but would work?No that is a very bad idea and would use way too much memory. InsaneLimits works fine the way it is. You just have to stop fighting it and accept using OnSpawn like I have been telling you to do. IT WORKS. Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 16, 2016 Author Share Posted April 16, 2016 Originally Posted by BuRockK*: No that is a very bad idea and would use way too much memory. InsaneLimits works fine the way it is. You just have to stop fighting it and accept using OnSpawn like I have been telling you to do. IT WORKS.Yea, but ill be using both. If onJoin fails (which will eventually) it will do the job in OnSpawn Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 16, 2016 Author Share Posted April 16, 2016 Originally Posted by s1ngular1ty*: Or you could get rid of both of those and do OnIntervalPlayers and set the interval to like 20 seconds. That way they will always be caught no matter what. Quote * Restored post. It could be that the author is no longer active. Link to comment
ImportBot Posted April 16, 2016 Author Share Posted April 16, 2016 Originally Posted by BuRockK*: Yea that could also work Quote * Restored post. It could be that the author is no longer active. Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.