Hell-Mate Posted March 9, 2014 Share Posted March 9, 2014 Hello community ,, i've made a simple script to prevent hacking, it only prevent some serials to login to the account and if anyone tried to login that's not in the serial list, will get banned. but i have to open the script every time to add lines of serials annd account names. so i decided to make it with gui which can add or remove serials for every acc name. i mean for example every acc can do /myserials and a gui pop up and an edit box that i have to write the serial and three buttons "Add", "Remove", "Close". well my question is how to use guiGetText and then add what the player wrote in the script.? here is my simple script > AccessList = {[ 'accountName' ] = 'playerSerial', [ 'HERE IS ACC NAME' ] = 'HERE IS SERIAL',} -- i want the line auto added here when the player press add and auto remove when the player press remove function PreventHackers ( _, loggedaccount ) local GetTheSerial = AccessList[getAccountName(loggedaccount)] if ( GetTheSerial ) then if GetTheSerial ~= getPlayerSerial ( source ) then local BanSerial = getPlayerSerial ( source ) addBan( nil, nil, BanSerial, source, "You've been banned for 2000 seconds for trying to hack an account", 2000 ) outputChatBox ( " Your serial is not allowed to access this account ",source,255,0,0,false ) else outputChatBox ( " You passed the serial check and logged in successfully ",source,0,255,0,false ) end end end addEventHandler ( 'onPlayerLogin', getRootElement ( ), PreventHackers ) i hope that someone can help Link to comment
Hell-Mate Posted March 9, 2014 Author Share Posted March 9, 2014 dude, u think now i understood ? Link to comment
teQuilla Posted March 9, 2014 Share Posted March 9, 2014 The table inside the script is bad , you're going to lose the table everytime the script is getting restarted, I'd suggest you using XML or even account data , but not tables. Link to comment
Hell-Mate Posted March 9, 2014 Author Share Posted March 9, 2014 I've no idea how to use XML in scripting never used such a way in scripting. that what im asking about. Link to comment
Bonsai Posted March 9, 2014 Share Posted March 9, 2014 dude, u think now i understood ? Okay, Sorry You can save anything in XML files that you want to keep even after restart. There are several functions to create, modify those files. Pretty simple, you only have to try it. Check the wiki. If I got you right you will need server side existing xml. Link to comment
teQuilla Posted March 9, 2014 Share Posted March 9, 2014 Account data is your friend in that case , just save the serial of the player when he logs in , and use the event : onPlayerLogin to get the account , then get the serial through getAccountData , and compare it to who tries to login . If it doesn't match , just use cancelEvent() . Link to comment
iPrestege Posted March 9, 2014 Share Posted March 9, 2014 No you can use command or anything else there's no need to make a gui and add the account and get the player serial then use table.insert function as far as i know. Link to comment
teQuilla Posted March 9, 2014 Share Posted March 9, 2014 CVC , then again , he's going to lose the table everytime he's restarting the script . Link to comment
iPrestege Posted March 9, 2014 Share Posted March 9, 2014 Oh didn't notice about what he was asking i thought that he want to add users lol . Link to comment
Hell-Mate Posted March 9, 2014 Author Share Posted March 9, 2014 and how to use table.insert at XML ? Link to comment
iPrestege Posted March 9, 2014 Share Posted March 9, 2014 There's no need i thought you want to ask about another thing. You can also use 'SqlLite' or 'MySQL' . 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