Jump to content

Question.


Recommended Posts

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
dude, u think now i understood ? xD

Okay, Sorry :P

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...