Jump to content

dragonslife

Members
  • Content Count

    22
  • Joined

  • Last visited

Community Reputation

0 Neutral

About dragonslife

  • Rank
    Civilian
  1. Look, here's my code client side function createLoginWindow() -- define the X and Y positions of the window local X = 0.335 local Y = 0.375 -- define the width and height of the window local Width = 0.35 local Height = 0.25 -- create the window and save it's element value into the variable "wdwLogin" wdwLogin = guiCreateWindow(X, Y, Width, Height, "Please login with your username and password", true) -- define new X and Y positions for the first label. X = 0.0825 Y = 0.230 -- define new Width and Height values for the first l
  2. Ok so, I got this code now server side: function registerPlayer(username,password, password2) outputChatBox( "Username:"..username.." Password: "..password.."password confirm"..password2, source ) -- if player not write username. if not (username == "") then -- if player not write password. if not (password == "") then -- verify that both passwords are the same. if (password == password2) then local account = getAccount (username,password) -- get account if ( not getAccount ( username ) ) then
  3. What would be the command to activate a function on the client side from the server side? triggerClientEvent(......) ??
  4. Got it fixed now, changed: under default user to:
  5. Found the problem, the server reported this: [2012-03-21 14:16:09] WARNING: myserver\script.lua:31: Access denied @ 'addAccount' But anyone has an idea why it got acces denied? and where/how I can change that?
  6. When I try to create an account, I frist try to leave the field empty, then it reports that I left the fields empty, which is good. Next I'm filling in an excisting accountname, then it tells me the account name already excists, which is good also. But when I enter a non-excisting account name and press account, it's saying it couldn't create an account and that I should contact an admin.. But I don't understand why it's not able to create the account?
  7. Ok so I now got this. script.lua function registerPlayer(username,password) outputChatBox( "Username:"..username.." Password: "..password, source ) if not (username == "") then -- if player not write username if not (password == "") then -- if player not write password local account = getAccount (username,password) -- get account if ( not getAccount ( username ) ) then local accountAdded = addAccount(username, password) -- added with username and pass from client if (accountAdded) then -- if account added write mess
  8. It should work with the code i got earlier in this topic... but something in that code is making it stop at the "if".
  9. Ok so, I now have the following code: function createRegisterWindow() -- define the X and Y positions of the window local X = 0.335 local Y = 0.375 -- define the width and height of the window local Width = 0.35 local Height = 0.25 -- create the window and save it's element value into the variable "wdwLogin" -- click on the function's name to read its documentation. wdwRegister = guiCreateWindow(X, Y, Width, Height, "Please register with an username and password", true) -- define new X and Y positions for the first label. X = 0.0825
  10. Hello People, I'm working in the map editor in MTA. Now I have a place where I wan't to build a mechanics garage only there's a tree and some leaves in the way. Is it possible to remove these? because I can't seem to target them or select them somehow in order to delete them.
  11. somehow with this code i keep getting the message that I should fill in a username and password, which I did. While the code clearly says, if something is filled in, check if it excists, if not create account... right? function registerPlayer ( username, password ) if ( password ~= "" and password ~= nil and username ~= "" and username ~= nil ) then if ( not getAccount ( username ) ) then local accountAdded = addAccount ( username, password ) if ( accountAdded ) then outputChatBox ( "Thank you " .. getPlayerName ( source ) .. ", You c
  12. Ok so I've been messing arround a bit more.. I added a register button to my login screen. When you press the register button it's supposed to hide the login window and create a new window for the register window. Except when I press my register button nothing happens, the login button does work tough. I've been looking over my code quite a few times and couldn't find out why it wouldn't respond when the register button is clicked. Here's my code so far: function createLoginWindow() -- define the X and Y positions of the window local X = 0.335 local Y = 0.375 --
  13. Ok been messing arround a bit... my login screen looks like this now Now i tried movind the username and password text up.. but no matter where to i change the x and y amounts, it wont move. it does respond to the y amount between username and password tough. My code is like this: X = 0.0825 y = 0.2 -- define new Width and Height values for the first label. Width = 0.50 Height = 0.50 -- create the first label, note the final argument passed is 'wdwLogin' meaning the window -- we created above is the parent of this label (so all the position and size v
  14. Yaaaaaaaaaaay! It's working now! thanks alot people!! =D
  15. I editted my code again, it's like this now script.lua -- create our loginHandler function, with username and password parameters (passed from the client GUI). function loginHandler(username,password) -- check that the username and password are correct. local acc = getAccount(username, password) -- the player has succesfully logged in, so spawn them. if (acc) then logIn (source, acc, password) spawnPlayer (source, 1959.55, -1714.46, 10) fadeCamera(source, true) setCameraTarget(source) outputChat
×
×
  • Create New...