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.