Jump to content

Snoozy

Members
  • Posts

    79
  • Joined

  • Last visited

Everything posted by Snoozy

  1. Ah well to ask the "why", I'm new at LUA, coming from a PAWN environment of scripting so really not used to clientside, serverside, you think changing those will fix it?
  2. I keep getting the error ERROR: Client triggered serverside event submitLogin, but event is not added serverside I'm rather confused about this and have been unable to find the problem. function loginHandler(username,password) handler = mysql_connect(".......", ".....", "......", ".....") if ( not handler ) then outputChatBox("Unable to connect to the MySQL server") else outputChatBox("Able to connect to the MySQL server") mysql_close(handler) end if username == "g" and password == "a" then if (source) then guiSetInputEnabled(false) guiSetVisible(wdwLogin, false) showCursor(false) outputChatBox("Logged in successfully",source) spawnPlayer(source, 1959.55, -1714.46, 10) fadeCamera(source, true) setCameraTarget(source) end else outputChatBox("Invalid username and password. Please re-connect and try again.",source) end end addEvent("submitLogin",true) addEventHandler("submitLogin",root,loginHandler) AND triggerServerEvent ("submitLogin", getLocalPlayer(),username,password) When clicking the button that is executing that trigger event nothing happens ingame but in console the above error is happening.
  3. Would certainly explain the problems I'm having. Thanks just wanted to be sure it's not me messing something else up.
  4. Hey, so yea I'm a max noob at LUA coming from PAWN and having some harsh times even getting mysql_connect(arg1,arg2,arg3,arg4) to work without problems. My problem is that, I'm trying to execute the simple handler = mysql_connect("IP", "¤¤¤¤", ""####", "......") -- Establish the connection if ( not handler ) then -- The connection failed outputDebugString("Unable to connect to the MySQL server") else outputDebugString("Able to connect to the MySQL server") mysql_close(handler) -- Close the connection end Also, I'm trying to execute it clientside will that be a problem? When I try, it like f's the whole script up like nothing works then the GUI that is meant to come after that wont come or anything it simply just makes the script not functionally working and it's starting to get annoying. I'm wondering what could be causing this, only thing I can think of is it being clientside.
×
×
  • Create New...