Jump to content

KieronWiltshire

Members
  • Posts

    20
  • Joined

  • Last visited

Everything posted by KieronWiltshire

  1. I was wondering if anyone here has managed to not use MyBB's permission system? I'd really like to make my own which allows me to use on multiple applications such as MTA:SA, so like I will have a universal permission system.
  2. Is there a property or something I could configure in order to get text aligned to the center of a label. I don't want any solutions in 'hard code'. I'm just wondering, that's all!
  3. I am, but my events were not working, so i tried other events to make sure what the issue was... Besides i need to hide the gui after login etc...
  4. I want to keep the @ and . symbols though for the email, is this possible?
  5. No it honestly doesn't all the code is in gui, the client-script is empty for now...
  6. Just says they don't exist client side...
  7. Issue with my event handlers. ServerSide local SQL_HOST = "127.0.0.1" local SQL_USERNAME = "root" local SQL_PASSWORD = "" function connect() accountsDatabase = dbConnect( "mysql", SQL_HOST, SQL_USERNAME, SQL_PASSWORD, "share=0" ) outputChatBox("connected") checkExists() triggerClientEvent("hideLoginWindow", getRootElement()) triggerClientEvent("hideRegisterWindow", getRootElement()) end addEventHandler ( "onResourceStart", getRootElement(), connect ) ClientSide --Display the login window to the root element function displayLoginWindow() --source is the player in this case. guiSetVisible(loginWindow, true ) outputChatBox("displayed") end --Hide the login window to the root element function hideLoginWindow() --source is the player in this case. guiSetVisible(loginWindow, false ) end --Display the register window to the root element function displayRegisterWindow() --source is the player in this case. guiSetVisible(registerWindow, true ) end --Hide the login window to the root element function hideRegisterWindow() --source is the player in this case. guiSetVisible(registerWindow, false ) end --[[ LOGIN ALERT LABEL FUNCTIONS ]]-- --Set the login label to a custom message function setLoginAlertLabel(message) guiSetText( loginAlertLabel, message ) end --"Your email or password maybe incorrect or doesn't exit. If the account \ndoesn't exist please create an account before attempting to login." --[[ REGISTER ALERT LABEL FUNCTIONS ]]-- --Set the register label to a custom message function setRegisterFullNameAlertLabel(message) guiSetText( registerFullNameAlertLabel, message ) end --Set the email alert label to a custom message function setRegisterEmailAlertLabel(message) guiSetText( registerEmailAlertLabel, message ) end --Set the password alert label to a custom message function setRegisterPasswordAlertLabel(message) guiSetText( registerPasswordAlertLabel, message ) end addEvent( "displayLoginWindow", true ) addEvent( "hideLoginWindow", true ) addEvent( "displayRegisterWindow", true ) addEvent( "hideRegisterWindow", true ) addEvent( "setLoginAlertLabel", true ) addEvent( "setRegisterFullNameAlertLabel", true ) addEvent( "setRegisterEmailAlertLabel", true ) addEvent( "setRegisterPasswordAlertLabel", true ) addEventHandler( "displayLoginWindow", getRootElement(), displayLoginWindow ) addEventHandler( "hideLoginWindow", getRootElement(), hideLoginWindow ) addEventHandler( "displayRegisterWindow", getRootElement(), displayRegisterWindow ) addEventHandler( "hideRegisterWindow", getRootElement(), hideRegisterWindow ) addEventHandler( "setLoginAlertLabel", getRootElement(), setLoginAlertLabel ) addEventHandler( "setRegisterFullNameAlertLabel", getRootElement(), setRegisterFullNameAlertLabel ) addEventHandler( "setRegisterEmailAlertLabel", getRootElement(), setRegisterEmailAlertLabel ) addEventHandler( "setRegisterPasswordAlertLabel", getRootElement(), setRegisterPasswordAlertLabel ) My meta: <meta> <!-- SCRIPT INFORMATION --> <info author="Kieron Wiltshire" type="script" name="ZedLogin" description="Zed login script" /> <script src="gui.lua" type="client" /> <script src="login-server.lua" type="server" /> <script src="login-client.lua" type="client" /> </meta>
  8. So, now for my login function, would I also encrypt the password to MD5 on login and check the encryption from SQL and from login?
  9. How should I store passwords? I would like to encrypt them to SHA1 or MD5 if possible
  10. I know that, I just don't want to type each individual character out...
  11. Does anyone have a function which I can use which checks for illegal characters for things like usernames and stuff please?
  12. It would be much appreciated if you could explain the if statement please, I would really like to know what's going on so I grasp it better.
  13. Can anyone please help me, I really want to get this finished by tonight if possible.
  14. Thanks, but what about my 2nd question about finishing the query, can you help me there as well please?
  15. No, I mean the SELECT FROM INSERT, that kinda stuff, where can I look this up? Also you know the dbPoll, how I use it to check if a user exists in a database... i.e --Check if the email already exists.. function emailExists(email) local query = dbQuery ( accountsDatabase, "SELECT * FROM users WHERE email=?", email ) local result = dbPoll ( query, - 1 ) if() then return true else return false end end how would I finish this code so I can check if the email exists, does dbPoll work like a for loop, does it look through each result, how can I check if email exists in database...
  16. So, I'm kinda new to MySQL and I know what a column/table is etc.. However I don't know some of the MySQL commands like SELECT, INSERT INTO, I was wondering if someone could send me a link to a decent documentation on MySQL commands please? Also how would I store encrypted passwords into a SQL database? Also how do I check the result of a query to see if the email exists in a database?
  17. Add the feature of this: Player tries to join server, if the server has disallowBanned = true, then don't allow him on, if they have it on false, then when he joins a message is sent to the admin warning them that this player has previous bans.
  18. source is an hidden variable, you don't need to define it. There is a list of predefined variable: https://forum.multitheftauto.com/viewtopic.php?f=91&t=39678 ----------------------------------------------- And about setCameraMatrix, the wiki say it: https://wiki.multitheftauto.com/wiki/SetCameraMatrix Oh okay so there are parameters but they're like hidden ones? okay, I kinda understand now thanks
  19. You should always really try to avoid recursive function calling unless it's absolutely needed which for example is in this case.
  20. Okay so I did scripting a while back for MTA:SA but never actually knew what I was doing, just more or less copied + pasted code from others and made it work. How ever I'm now fully experienced and I'm just lost on a few things if people could clear up that would be great, thank you! Okay so usually in programming languages like C or Java you provide the parameters, and I noticed in MTA you don't always do so, like this for example: function whenPlayerJoins(player) end --Now here we have the event, getRootElement(), and the function. But why isn't the function like so: --whenPlayerJoins(source) or something similar? addEventHandler ( "onPlayerJoin", getRootElement(), whenPlayerJoins ) Also there are certain things on the wiki which don't make much sense to me like setCameraMatrix, I'm guessing this just suspends the player's camera in a location, however when you actually want to set the player's camera back to his body how can you do such things? It doesn't really say How can I determine these things without asking here? Where on the wiki can I get the information I need for resetting a player's camera etc...
×
×
  • Create New...