• Gm_MySql v1.0 - OO edition.
    824 replies, posted
  • Avatar of Aide
  • [QUOTE=_NewBee;33005020]That would be just silly if there's other ways.[/QUOTE] Well your not making it easy, So please either pick one of methods stated above or go back to windows(or even linux).
  • If you have the source, you compile it the same way as you would on a linux system. ./configure and make. Assuming the source has the make files. Also, why do you need it compiled on OS x? Do you plan on running a dedicated server on your Mac?
  • Avatar of mr.wolf
  • [QUOTE=_NewBee;32961323]Because it's faster to test scripts in single player while you're still working on them, rather than upload them evereytime you make a change you want to test.[/QUOTE]
  • Aah. I have my server directory mounted to my desktop via sshfs, so I edit everything directly and restart the server when I want to test a change. I believe I'm in the same scenario as you. Headless linux server, development on a MacBook. [URL="http://www.turingtarpit.com/2009/04/mounting-remote-filesystems-on-osx-leopard-using-sshfs-macfuse-and-macfusion/"]http://www.turingtarpit.com/2009/04/mounting-remote-filesystems-on-osx-leopard-using-sshfs-macfuse-and-macfusion/[/URL]
  • Anyone tell me why I'm getting this error: Timer Error: [garrysmod\gamemodes\mmorpg\gamemode\mysql.lua:46] attempt to concatenate global 'level' (a userdata value) Error: Trying to network unacceptable type ((null)) function connectToDatabase() databaseObject = mysqloo.connect(DATABASE_HOST, DATABASE_USERNAME, DATABASE_PASSWORD, DATABASE_NAME, DATABASE_PORT) databaseObject.onConnected = function() print("Database linked!") end databaseObject.onConnectionFailed = function() print("Failed to connect to the database.") end databaseObject:connect() end connectToDatabase() function checkQuery(query) local playerInfo = query:getData() if playerInfo[1] ~= nil then return true else return false end end function sql_value_stats ( ply ) timer.Create("Atimmer", 10, 1, function() ID = databaseObject:query("SELECT ID FROM Players WHERE ID = '"..ply:SteamID().."'") money = databaseObject:query("SELECT Money FROM Players WHERE ID = '"..ply:SteamID().."'") level = databaseObject:query("SELECT Level FROM Players WHERE ID = '"..ply:SteamID().."'") ID.start() money.start() level.start() ply:SetNWString("ID", ID) ply:SetNWInt("money", money) ply:SetNWInt("level", level) testing123(ply) end) end function testing123(ply) level = ply:GetNWInt("level") ply:ChatPrint("Level is: "..level.." Money Is:") -- HERE IS LINE 46 end function FirstJoinMysql( ply ) local query1 = databaseObject:query("SELECT * FROM Players WHERE ID = '" .. ply:SteamID() .. "'") query1.onSuccess = function(q) if not checkQuery(q) then local query2 = databaseObject:query("INSERT INTO Players(ID, Money, Level) VALUES ('" .. ply:SteamID() .. "', " .. 15 .. ", " .. 1 .. ")") // else create the bugger query2.onSuccess = function(q) print("Created you!") end query2.onError = function(q,e) print("something went wrong") end query2:start() sql_value_stats(ply) else sql_value_stats(ply) print("You are already created!") end end query1.onError = function(Q,E) print("something went wrong when checking") print(E) end query1:start() end hook.Add( "PlayerInitialSpawn", "PlayerInitialSpawn", FirstJoinMysql )
  • Avatar of alexgrist
  • Anyone else get "attempt to call number value" when running a query like [code]CREATE TABLE IF NOT EXISTS `players` ( `_Key` smallint(11) unsigned NOT NULL AUTO_INCREMENT, `_Data` text NOT NULL PRIMARY KEY (`_Key`) );[/code]
  • Avatar of Surf3rDud3
  • I dont know if i have i have the files in the wrong places but i followed the Install Info. But here's what i get... [CODE]> require ( mysqloo )... [@lua_run:1] bad argument #1 to 'require' (string expected, got table)[/CODE]
  • Avatar of Surf3rDud3
  • [QUOTE=Knallex;33115308]lua_run require( 'mysqloo' )[/QUOTE] Wut... I typed that to get that message...
  • Avatar of Kenny_
  • [QUOTE=Surf3rDud3;33132393]Wut... I typed that to get that message...[/QUOTE] The name of the module needs to be enclosed in quotes.
  • Avatar of Surf3rDud3
  • [QUOTE=Kenny_;33132427]The name of the module needs to be enclosed in quotes.[/QUOTE] Show me please.
  • Avatar of Surf3rDud3
  • Dude... i type that... and i get this... [CODE]> require ( ' mysqloo ' )... LuaGetfile: Not Loading includes\modules\ mysqloo .lua ERROR! Module ' mysqloo ' not found![/CODE]
  • Avatar of Kenny_
  • Yes. You might also want to change your rcon password if you haven't already.
  • Avatar of lorde banana
  • [QUOTE=Surf3rDud3;33162455]So if it response with... [CODE]require[[mysqloo]]...[/CODE] Its working?[/QUOTE] [code]require([[mysqloo]])[/code]
  • Avatar of Surf3rDud3
  • [QUOTE=Banana Lord.;33162553][code]require([[mysqloo]])[/code][/QUOTE] Its showing... [CODE]require ( [[mysqloo]] )...[/CODE] Im on a wild goose chase...
  • Avatar of Teddi
  • Stop trying to do this in game and just put it straight into your script. You can either use- [lua] require("mysqloo") require('mysqloo') require([[mysqloo]]) [/lua] I really don't see how you can muck that up.
  • Avatar of c-unitV3
  • [QUOTE=Teddi Orange;33165066]Stop trying to do this in game and just put it straight into your script. You can either use- [lua] require("mysqloo") require('mysqloo') require([[mysqloo]]) [/lua] I really don't see how you can muck that up.[/QUOTE] require[[mysqloo]] should work too, just as require"mysqloo" should work.
  • Avatar of Teddi
  • [QUOTE=c-unitV3;33165718]require[[mysqloo]] should work too, just as require"mysqloo" should work.[/QUOTE] Lets not confuse the poster now.
  • Avatar of c-unitV3
  • [img]http://dl.dropbox.com/u/10105043/MyPics/My_Steamworks_module.png[/img] It works, and yes, the only reason I posted this picture was to show off my own steamworks module :)
  • Hey, myself and 2 other people have been debugging the hell out of this function, and we can NOT figure out what's wrong with it [LUA] function DeleteServer(ply) print("Running Delete Server") local playerID= ply:UniqueID() print(playerID) local query = databaseObject:query("DELETE FROM servers WHERE Owner_ID = '"..playerID.."'") query.onSuccess = function() print("Deleted server from database") end query.onError = function() print("Error deleting server from database") end query.onFailure = function() print("Failed to delete server from database") end query.start() print("Server should have been deleted") end [/LUA] It's being called from another function, which is running fine, and its being called. Here's the console output: [CODE] Running Delete Server **players uID snipped out** Server should have been deleted Invalid object! (not userdata) [/CODE] Does anyone have any idea what's up with this function? The same script has 4 other select, insert and update functions, and all of those work fine. In case anyone is wondering, one of the functions in the same script is inserting data into the same table with the players uID. As you can see, it isn't running the .onSuccess or .onError functions, and status() gives another Invalid Object