Mount Posted January 5, 2008 Share Posted January 5, 2008 (edited) Pingkicker v0.2 by Patrick "Mount" Rombouts ========================================== Functions: - Pingkicker - Configurable ping warning - FPS kicker - getClientFPS - Automaticly saves/loads config ========================================== Usage: - How to set the maxping to 150: /maxping 150 - Disabling the Pingkicker /maxping 0 OR /maxping off - Enabling the Pingkicker /maxping on - How to set the Pingwarning to 100: /pingwarning 100 - Disabling the Pingwarning /pingwarning 0 OR /pingwarning off - Enabling the Pingwarning /pingwarning on - How to set the minimal fps to 10: /minfps 10 - Disabling the minimal fps checker /minfps 0 OR /minfps off - Enabling the minimal fps checker /minfps on - Calling getPlayerFPS from your script local playerFPS = call(getResourceFromName("pingkicker"), "getClientFPS") Note: Returns nil when the ping is unknown, or the player doesnt exist ========================================== Changelog: 08/01/2008 - v0.2 - You can get the playerFPS from the script with getClientFPS (See usage) - Added FPS Kicker - Added an delay before kicking the player - Added ASE tags - Using get() and set() for settings now, command.xmlLoadFile as right is not needed anymore - Added some debug messages - Changed checkPings() to check for a pingwarning even if the maxping is turned off - Pingwarning now depends on the ACL of maxping, everybody who can do maxping, can do pingwarning 05/01/2008 - v0.1 - Inital release ========================================== DO NOT FORGET THIS!!!! The script needs the following right(s): command.kickPlayer Command(s) you need to protect with ACL: command.maxping command.pingwarning command.minfps ========================================== Credits: #mta.scripting and users for helping me AlienX for looking at my stupid bugs Ping Warning picture by [sG]Duckje Greets to: Rachel MTA Team SeriousGamers Download: http://www.sitebar.nl/releases/mtadm/pingkicker.zip Screenshot of the pingwarner: http://www.sitebar.nl/releases/mtadm/pingkicker-warning.png Have fun, Mount Edited January 8, 2008 by Guest Link to comment
BrokenGlass Posted January 5, 2008 Share Posted January 5, 2008 Very nice! will come in handy Link to comment
onkelz98 Posted January 5, 2008 Share Posted January 5, 2008 Hi WARNING: server.lua: Access denied @ 'kickPlayer' - Line: 16 Link to comment
Mount Posted January 5, 2008 Author Share Posted January 5, 2008 HiWARNING: server.lua: Access denied @ 'kickPlayer' - Line: 16 Did you even read my whole post? ACL rights needed:command.kickPlayer command.xmlLoadFile You need to add an ACL group, with that rights. And then add resource.pingkicker to it Btw: here is a screenshot of the pingwarning: http://www.sitebar.nl/releases/mtadm/pingkicker-warning.png Link to comment
Guest Posted January 6, 2008 Share Posted January 6, 2008 ping kicker have no acces to kick player. from what i read i have to create group in acl... if im not wrong somethin like this: and then it messed for me with these rights, could you post how should look the next parts: ACL rights needed: command.kickPlayer command.xmlLoadFile Commands you need to protect with ACL: command.maxping command.pingwarning Thanks Link to comment
Mount Posted January 6, 2008 Author Share Posted January 6, 2008 <group name="Pingkicker"> <acl name="Pingkicker"/> <object name="resource.pingkicker"/> </group> <acl name="Pingkicker"> <right name="function.kickPlayer" access="true"/> <right name="function.xmlLoadFile" access="true"/> </acl> Link to comment
ChrML Posted January 6, 2008 Share Posted January 6, 2008 Remember to restrict the maxping and the pingwarning commands. Add this to the Everyone group: <right name="command.maxping" access="false"/> <right name="command.pingwarning" access="false"/> And this to the group you want to have access to it: <right name="command.maxping" access="true"/> <right name="command.pingwarning" access="true"/> Mount: For safetyness, you can add a "true" argument at the end of addCommandHandler. Will make it restricted and disabled by default unless allowed by ACL. Link to comment
eAi Posted January 6, 2008 Share Posted January 6, 2008 I'd suggest you could use settings instead of custom commands too. Link to comment
Mount Posted January 7, 2008 Author Share Posted January 7, 2008 Mount: For safetyness, you can add a "true" argument at the end of addCommandHandler. Will make it restricted and disabled by default unless allowed by ACL. Thank you for the tip, adding it in version 0.2 I'd suggest you could use settings instead of custom commands too. I have planned that already, im just waiting till the bug is fixed (viewtopic.php?f=90&t=21024) Link to comment
Mount Posted January 8, 2008 Author Share Posted January 8, 2008 0.2 is out, see mainpost Link to comment
Guest Posted January 16, 2008 Share Posted January 16, 2008 kickPlayer(thePlayer, nil, reason) should be kickPlayer(thePlayer, getRootElement(), reason) if you want it to show the reason Link to comment
PoLiNi Posted January 16, 2008 Share Posted January 16, 2008 Thanks alot, this will be usefull on a server of my friend, though it kicks straight away when the ping comes above the max isnt it? and it isnt kicking over the average ping some1 has... That would be better because some people have a little ping "SPIKE" as i will call it that the ping will be high for 1 fraction and after that it will go back down, but the ping was a moment above the max and ppl get kicked by than as i understood Link to comment
DazzaJay Posted January 17, 2008 Share Posted January 17, 2008 theres an issue with it. i was able to change the ping warning and max ping settings without being logged in as an admin. Link to comment
[UVA]Bart Posted January 17, 2008 Share Posted January 17, 2008 i dont use this but i know on my server you can changemap and mode without being logged in Link to comment
eAi Posted January 17, 2008 Share Posted January 17, 2008 Well, update the ACL then... Link to comment
DazzaJay Posted January 17, 2008 Share Posted January 17, 2008 i have done this...... Remember to restrict the maxping and the pingwarning commands.Add this to the Everyone group: <right name="command.maxping" access="false"/> <right name="command.pingwarning" access="false"/> And this to the group you want to have access to it: <right name="command.maxping" access="true"/> <right name="command.pingwarning" access="true"/> Mount: For safetyness, you can add a "true" argument at the end of addCommandHandler. Will make it restricted and disabled by default unless allowed by ACL. And this..... <group name="Pingkicker"> <acl name="Pingkicker"/> <object name="resource.pingkicker"/> </group> <acl name="Pingkicker"> <right name="function.kickPlayer" access="true"/> <right name="function.xmlLoadFile" access="true"/> </acl> and still any random can adjust the ping kikcer settings. and also, another thing i just discovered..... if i go into the admin panel in game, and try to stop the pingkicker resource.... the server window says "Stopping pingkicker" then the allmighty windows "MTA Server.exe has encountered a problem and needs to close" box appears. Error Signature: AppName: mta server.exe AppVer: 0.0.0.0 ModName: deathmatch.dll ModVer: 0.0.0.0 Offset: 0004a5ea Link to comment
Guest Posted January 18, 2008 Share Posted January 18, 2008 It crashes because of a bug with the set() function, just comment out 6 lines under OnResourceStop https://forum.multitheftauto.com/viewtopic.php?f=91&t=21102&p=268999&hilit=set#p268999 Link to comment
DazzaJay Posted January 24, 2008 Share Posted January 24, 2008 Also, i have a suggestion for it. a "warning" of some kind to say that the clients FPS is low. and also... i have found a small issue with it. If in a server like mine, where there is about 1MB of recources to give out, as soon as a player joins, and starts reciving the recources, his ping skyrockets till he has recived it, and often gets kicked before he can recive the recources. so i recomend a Settable timer or "Grace Period" where a player will not be checked for ping untill being in the game for 30 seconds. also, same on other recource loads. Link to comment
Jumba' Posted January 24, 2008 Share Posted January 24, 2008 Also, i have a suggestion for it.a "warning" of some kind to say that the clients FPS is low. and also... i have found a small issue with it. If in a server like mine, where there is about 1MB of recources to give out, as soon as a player joins, and starts reciving the recources, his ping skyrockets till he has recived it, and often gets kicked before he can recive the recources. so i recomend a Settable timer or "Grace Period" where a player will not be checked for ping untill being in the game for 30 seconds. also, same on other recource loads. 30 seconds? hah, i take 2 mins to download 1 mb on a bad day. Just make the pingkicker start onPlayerSpawn Link to comment
DazzaJay Posted January 24, 2008 Share Posted January 24, 2008 That could work. also, another thing i just thaught of.... copy the animation from Race, where the image "Hurry" has a pulse animation, as that would be really noticeable on the "high ping" image. Link to comment
Evilman926 Posted May 29, 2008 Share Posted May 29, 2008 Im Trying 2 figur out how 2 change it from 3 sec 2 120 secs any ideas Link to comment
DazzaJay Posted May 29, 2008 Share Posted May 29, 2008 Change the kickPlayerWithDelay time from 3000 (3 seconds) to whatever you want i guess. Server.LUA setTimer (kickPlayerWithDelay, 3000, 1, thePlayer, "Too high ping (Max: " .. maxPingValue .. ")") outputChatBox ("Pingkicker: You will be kicked in 3 seconds, reason: Ping too high (Max: " .. maxPingValue .. ")", thePlayer, 255, 0, 0) Also, a chamnge i reccomend for EVERYONE using this script: In the client.lua Change Line 14 to this: pingwarning = guiCreateStaticImage( 0.38, 0.71, 0.26, 0.097, 'pingwarning.png', true, nil) This will make sure the image does not appear MASSIVE on Low Res (such as 640x480) and also that it wont appear Tiny on Rez's such as 1600X1200 with that line it will Scale the image to fit on every rez. Link to comment
Evilman926 Posted May 29, 2008 Share Posted May 29, 2008 So for 2 mins it will be 120000 Just want 2 make sure Link to comment
DazzaJay Posted May 29, 2008 Share Posted May 29, 2008 1000 = 1 Second 60000 = 1 minute (60 seconds) 120000 - 2 mins, Yes. (120 seconds) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now