1. Post #161
    Bloodclaw's Avatar
    June 2008
    296 Posts
    I'm having troubles getting the module to work under Debian 64.

    I placed the libmysql.so where srcds_run is (also made a link named libmySQL.so, just to be sure).
    I also placed the gmcl_mysqloo_i486.dll and gmsv_mysqloo_i846.dll into garrysmod/lua/includes/modules, but still, when the server start it says "ERROR! Module 'mysql' not found!".
    Reply With Quote Edit / Delete France Show Events Disagree Disagree x 1 (list)

  2. Post #162
    Gold Member
    raBBish's Avatar
    March 2007
    2,667 Posts
    "ERROR! Module 'mysql' not found!".
    Shouldn't you be requiring "mysqloo", not "mysql"?
    Reply With Quote Edit / Delete Finland Show Events Agree Agree x 1 (list)

  3. Post #163
    Bloodclaw's Avatar
    June 2008
    296 Posts
    Tried modifying the "require" to mysqloo, but it still give out the same error, except it's with mysqloo now.

    The addons I'm trying to install are UBan and UTimeM.
    Reply With Quote Edit / Delete France Show Events

  4. Post #164
    King of the Oil Refinery
    Tobba's Avatar
    December 2008
    6,229 Posts
    rename them to gmcl_mysqloo_linux and gmsv_mysqloo_linux

    Also if they are using MySQL module you shoulent use MySQLOO
    Reply With Quote Edit / Delete Sweden Show Events

  5. Post #165
    Bloodclaw's Avatar
    June 2008
    296 Posts
    Renaming does nothing, still the same error. Also the old mysql module does the same thing, and I don't know if it would works well since there is no Linux version.
    Reply With Quote Edit / Delete France Show Events

  6. Post #166
    King of the Oil Refinery
    Tobba's Avatar
    December 2008
    6,229 Posts
    Old mysql module dosent do the same thing AT ALL
    Reply With Quote Edit / Delete Sweden Show Events

  7. Post #167
    Bloodclaw's Avatar
    June 2008
    296 Posts
    By "does the same thing", I mean "it output the same error".
    Reply With Quote Edit / Delete France Show Events

  8. Post #168
    King of the Oil Refinery
    Tobba's Avatar
    December 2008
    6,229 Posts
    normal MySQL module isnt linux compatible and your installing this one wrong
    Reply With Quote Edit / Delete Sweden Show Events

  9. Post #169
    Robin_xD's Avatar
    February 2009
    53 Posts
    Nevermind about my problem, I'm using gm_mysql now, it's working fine
    Reply With Quote Edit / Delete Germany Show Events

  10. Post #170
    Shane's Avatar
    March 2010
    336 Posts
    Nevermind about my problem, I'm using gm_mysql now, it's working fine
    If only it was Linux friendly
    Reply With Quote Edit / Delete United States Show Events

  11. Post #171
    Bloodclaw's Avatar
    June 2008
    296 Posts
    normal MySQL module isnt linux compatible and your installing this one wrong
    That's what I said actually, and I'm posting here to know what I did wrong. I guess UBan and UTimeM won't work with MySQLOO then. Thanks for your help anyway.
    Reply With Quote Edit / Delete France Show Events

  12. Post #172
    grimd34th's Avatar
    July 2010
    6 Posts
    it does, you need to change the name of the included modules to *_linux.dll and in the init.lua put require("mysqloo")

    i used this method and got darkrp working
    Reply With Quote Edit / Delete United States Show Events Agree Agree x 1 (list)

  13. Post #173
    Bloodclaw's Avatar
    June 2008
    296 Posts
    Thanks a lot, it worked, or at least it now find the module. However, it prints some lua errors but I will go on ULX forums for that.
    Reply With Quote Edit / Delete France Show Events

  14. Post #174
    King of the Oil Refinery
    Tobba's Avatar
    December 2008
    6,229 Posts
    Dont clog up the ULX forums becuse your using the wrong module, the ULX stuff use gm_mysql
    this is gm_mysqloo, its a huge differeance
    Reply With Quote Edit / Delete Sweden Show Events Agree Agree x 1 (list)

  15. Post #175
    Bloodclaw's Avatar
    June 2008
    296 Posts
    And what if I would like to have UBan on my server which is hosted under Linux? I will surely not clog up their forum with one post and if they don't want to port it, then nevermind. It costs nothing to ask...
    Reply With Quote Edit / Delete France Show Events

  16. Post #176
    quality poster
    Dennab
    August 2009
    12,242 Posts
    function META:SaveMoneySQL()
    	print("function")
    	local pl = self
    
    	local databaseObject = mysqloo.connect(DATABASE_HOST, DATABASE_USERNAME, DATABASE_PASSWORD, DATABASE_NAME, DATABASE_PORT)
    	databaseObject.onConnected = function(database)
    	print("Testing: "..pl:GetPData("money"))
    	query = database:query("UPDATE bonkdm SET money='"..pl:GetPData("money").."' WHERE steamid='"..pl:SteamID().."'")
    	query:setOption(mysqloo.OPTION_NUMERIC_FIELDS, true)
    	query:setOption(mysqloo.OPTION_NAMED_FIELDS, false)
    	query:start()
    	end
    	databaseObject:connect()
    end

    "Attempt to call method 'SaveMoneySQL' (a nil value)"

    Am I the only one that is having an impossibly hard time getting this module to function like it should or..? I've required MySQLoo, I've declared the META, all the other meta functions in the file work, and yet whenever I bring MySQLoo into the equasion its just more debugging to do.
    Reply With Quote Edit / Delete United States Show Events Dumb Dumb x 1 (list)

  17. Post #177
    Shane's Avatar
    March 2010
    336 Posts
    function META:SaveMoneySQL()
    	print("function")
    	local pl = self
    
    	local databaseObject = mysqloo.connect(DATABASE_HOST, DATABASE_USERNAME, DATABASE_PASSWORD, DATABASE_NAME, DATABASE_PORT)
    	databaseObject.onConnected = function(database)
    	print("Testing: "..pl:GetPData("money"))
    	query = database:query("UPDATE bonkdm SET money='"..pl:GetPData("money").."' WHERE steamid='"..pl:SteamID().."'")
    	query:setOption(mysqloo.OPTION_NUMERIC_FIELDS, true)
    	query:setOption(mysqloo.OPTION_NAMED_FIELDS, false)
    	query:start()
    	end
    	databaseObject:connect()
    end

    "Attempt to call method 'SaveMoneySQL' (a nil value)"

    Am I the only one that is having an impossibly hard time getting this module to function like it should or..? I've required MySQLoo, I've declared the META, all the other meta functions in the file work, and yet whenever I bring MySQLoo into the equasion its just more debugging to do.
    Your not alone, I can't even get it to make a connection..
    Reply With Quote Edit / Delete United States Show Events

  18. Post #178
    quality poster
    Dennab
    August 2009
    12,242 Posts
    After a lot of unnecessary work I got it to query and connect, but the organization of the module is such a clusterfuck I have to bend over backwards just to set a meta functions return value to a query value..
    If I could find documentation on gm_tmysql I think I'd rather use it. No offense to you andy, you're a better programmer than I, but both of your SQL modules are handled so oddly I'd have an easier time reading an encrypted message through a cereal box decoder ring.
    Reply With Quote Edit / Delete United States Show Events

  19. Post #179
    Gold Member
    AzuiSleet's Avatar
    September 2007
    758 Posts
    If I could find documentation on gm_tmysql

    http://code.google.com/p/gmodmodules...ql3/readme.txt
    Reply With Quote Edit / Delete United States Show Events

  20. Post #180
    quality poster
    Dennab
    August 2009
    12,242 Posts
    Heh, I actually came here to snip that. Thanks for the module.

    Edited:

    function InitializeSQL()
    	tmysql.initialize(DATABASE_HOST, DATABASE_USERNAME, DATABASE_PASSWORD, DATABASE_NAME, DATABASE_PORT, 10, 1)
    	print("=========================================")
    	print("Successfully connected to MySQL database!")
    	print("=========================================")
    end
    hook.Add("Initialize", "ConnectToSQL", InitializeSQL)
    
    function CheckForSQL(result, status, error)
    	PrintTable(result)
    end
    
    function GM:PlayerInitialSpawn(pl)
    	tmysql.query("SELECT name IN TestTable WHERE SteamID='"..pl:SteamID().."'", CheckForSQL())
    	
    	local money = pl:GetPData("money")
            pl:SetTeam(1)
    	   
    	if (tonumber(money) == nil) then  
                pl:SetMoney(MONEY_STARTAMOUNT)
            else
                pl:SetMoney(tonumber(money))
            end
    end

    Returns:

    ERROR: GAMEMODE:'PlayerInitialSpawn' Failed: lua\includes\util.lua:35: bad argument #1 to 'pairs' (table expected, got nil)
    First off, because Port, Number Of Connections and Threads are all in brackets, I had assumed they were optional arguments, however, when unspecified, it wouldnt connect and I would recieve an error. The same goes for the 3 arguments other than the query in the Query function. I've tried calling the callback function via the following methods in arguments:

    CheckForSQL
    CheckForSQL()
    CheckForSQL(result, status, error)

    And yet I'm still getting this error. Am I missing something here or am I just having terrible luck with MySQL modules, because it seems no matter what I do, one way or the other they simply will not work. I've tried everything I can think of and yet I cant get anything to work (And yes I'm requiring "tmysql"). I just want to get my server linked to my databases, is that too much to ask? :sigh:

    Edited:

    function InitializeSQL()
    	tmysql.initialize(host, user, pass, database)
    	print("=========================================")
    	print("Successfully connected to MySQL database!")
    	print("=========================================")
    end
    hook.Add("Initialize", "ConnectToSQL", InitializeSQL)

    Returns:

    Hook 'ConnectToSQL' Failed: gamemodes\mygamemode\gamemode\init.lua:11: bad argument #5 to 'initialize' (number expected, got table)
    :smithicide:
    Reply With Quote Edit / Delete United States Show Events Dumb Dumb x 1 (list)

  21. Post #181
    Gold Member
    AzuiSleet's Avatar
    September 2007
    758 Posts
    tmysql.initialize(host, user, pass, database)
    
    Pass the port or 0.

    As for the rest of your example, it isn't well structured so here's a proper example:

    local PlayerMeta = _R.Player
    
    function PlayerMeta:CheckForSQL( result, status, error )
        print( "Example query returned ", status )
        PrintTable( result )
    end
    
    function GM:PlayerInitialSpawn(pl)
    	tmysql.query( "SELECT name IN TestTable WHERE SteamID='"..pl:SteamID().."'" , pl.CheckForSQL, 0, pl )
    end
    Reply With Quote Edit / Delete United States Show Events

  22. Post #182
    quality poster
    Dennab
    August 2009
    12,242 Posts
    After passing the port I get:

    Hook 'ConnectToSQL' Failed: gamemodes\mygamemode\gamemode\init.lua:11: bad argument #6 to 'initialize' (number expected, got table)
    Reply With Quote Edit / Delete United States Show Events

  23. Post #183
    Gold Member
    AzuiSleet's Avatar
    September 2007
    758 Posts
    After passing the port I get:
    You're not using tmysql3 so you have to pass the number of connections and ports. This isn't the thread for tmysql though so let's try not to spam it.
    Reply With Quote Edit / Delete United States Show Events

  24. Post #184
    quality poster
    Dennab
    August 2009
    12,242 Posts
    You're not using tmysql3 so you have to pass the number of connections and ports. This isn't the thread for tmysql though so let's try not to spam it.
    Right sorry, I'll be back as soon as I find the tMySQL thread

    Edited:

    Apparently there isnt one :p
    Reply With Quote Edit / Delete United States Show Events Agree Agree x 1 (list)

  25. Post #185
    Gold Member

    August 2008
    35 Posts
    it does, you need to change the name of the included modules to *_linux.dll and in the init.lua put require("mysqloo")

    i used this method and got darkrp working
    Hmmm that hasn't been working for me.

    Anyone else get the module working on linux?
    Reply With Quote Edit / Delete United States Show Events

  26. Post #186
    Gold Member
    AndrewPH's Avatar
    July 2010
    704 Posts
    Hmmm that hasn't been working for me.

    Anyone else get the module working on linux?
    I have, it works fine.
    Reply With Quote Edit / Delete United States Show Events

  27. Post #187
    Gold Member

    August 2008
    35 Posts
    I have, it works fine.
    Can you maybe explain what you did please :P

    EDIT:
    Got it working :)
    Reply With Quote Edit / Delete United States Show Events

  28. Post #188
    metromod.net
    _Chewgum's Avatar
    April 2010
    2,216 Posts
    You're not using tmysql3 so you have to pass the number of connections and ports. This isn't the thread for tmysql though so let's try not to spam it.
    I guess tmysql3 is with linux support?
    Reply With Quote Edit / Delete United States Show Events Disagree Disagree x 1 (list)

  29. Post #189
    Terminal Shell Founder
    mr.wolf's Avatar
    July 2010
    820 Posts
    Is there a way to get the last inserted ID?
    Reply With Quote Edit / Delete United States Show Events

  30. Post #190
    Gold Member
    thomasfn's Avatar
    July 2008
    2,966 Posts
    Is there a way to get the last inserted ID?
    I have no idea if this will work or not, but run this query right after you make the insert:

    Code:
    SELECT @@IDENTITY AS ID
    This should return a table of a single row and single column, of the name 'ID', containing the last inserted ID. It has to be run on the same connection as the insert, and before you do any more inserts (so straight after will be fine).
    Reply With Quote Edit / Delete United Kingdom Show Events Informative Informative x 1 (list)

  31. Post #191
    WaterRatj's Avatar
    May 2010
    119 Posts
    Can anyone explain me a bit on how to use the tables outputed from a query?

    I'm trying to figure out on how to get the info from database but i'm struggling with it.

    Like when i recieve the table, i see the table name when doing print(table) but can't get data out for each row or just anything from it.

    Can someone throw me in he right direction?
    Reply With Quote Edit / Delete Belgium Show Events

  32. Post #192
    Saevus's Avatar
    June 2010
    394 Posts
    someone should make some tutorials for this :(
    Reply With Quote Edit / Delete United Kingdom Show Events Agree Agree x 2 (list)

  33. Post #193
    WaterRatj's Avatar
    May 2010
    119 Posts
    I agree!
    I love mysql in gamemodes but some more tutorials or guides or manual will gladly help!
    Cause this module would rock ( if I fully could understand it ^^)
    Reply With Quote Edit / Delete Belgium Show Events Agree Agree x 2 (list)

  34. Post #194
    Namaste's Avatar
    November 2009
    1,965 Posts
    I get error loading. System error 14001... Does this not work with 64 bit?
    Reply With Quote Edit / Delete United States Show Events

  35. Post #195
    WaterRatj's Avatar
    May 2010
    119 Posts
    Does query:onFailure even work?
    for now I use onError and that gives a query.

    Also whats the layout of the query given in onError? Cause PrintTable gives error about pairs (table expected, got Query)
    Reply With Quote Edit / Delete Belgium Show Events

  36. Post #196
    Saevus's Avatar
    June 2010
    394 Posts
    humblensurp's going to make a tutorial on how to make stuff using mysqloo

    check up on his channel ever so often :D

    http://www.youtube.com/user/humblesnurp
    Reply With Quote Edit / Delete United Kingdom Show Events Disagree Disagree x 1 (list)

  37. Post #197
    WaterRatj's Avatar
    May 2010
    119 Posts
    Yeah, managed to get alot working now.
    I just would like some explanation about the returns!

    What the table and queries contain when returned, other then that I can get it all runned.

    Also a updated list of functions (like the wait()) on the first topic would be helpfull.
    And if the example could get fixed, cause it contains errors!

    Thanks in advance

    Edited:

    humblensurp's going to make a tutorial on how to make stuff using mysqloo

    check up on his channel ever so often :D

    http://www.youtube.com/user/humblesnurp
    Also I don't like movies, I rather have text examples and snippets :D
    Reply With Quote Edit / Delete Belgium Show Events

  38. Post #198
    Saevus's Avatar
    June 2010
    394 Posts
    i would like to see a huge example of it querying the DB and inserting stuff that atchually works >:D
    Reply With Quote Edit / Delete United Kingdom Show Events Agree Agree x 1 (list)

  39. Post #199
    Gold Member

    April 2009
    726 Posts
    i would like to see a huge example of it querying the DB and inserting stuff that atchually works >:D
    Ill post how I did it when I get home :) (About 2 hours)
    Reply With Quote Edit / Delete Denmark Show Events Agree Agree x 1 (list)

  40. Post #200
    Gold Member

    April 2009
    726 Posts
    Here is how my Server logging addon do/did it:
    /*--------------------------------------------------------------------------
    	Start Config
    */--------------------------------------------------------------------------
    
    local DATABASE_HOST = ""		--Host
    local DATABASE_PORT = 3306						--Port
    local DATABASE_NAME = ""			--Database
    local DATABASE_USERNAME = ""				--Username
    local DATABASE_PASSWORD = ""			--Password
    
    /*--------------------------------------------------------------------------
    	End Config - Do not edit below this unless you know what you're doing!
    */------------------------------------------------ -------------------------
    
    
    /*--------------------------------------------------------------------------
    	Server Logging V2 - By Trivkz
    */------------------------------------------------ -------------------------
    
    require("mysqloo")
    
    
    local LOG_Connect = CreateClientConVar("log_connect", 1, true, false)
    local LOG_Spawn = CreateClientConVar("log_spawn", 1, true, false)
    local LOG_Death = CreateClientConVar("log_death", 1, true, false)
    local LOG_Disconnect = CreateClientConVar("log_disconnect", 1, true, false)
    local LOG_Propspawn = CreateClientConVar("log_propspawn", 1, true, false)
    local LOG_Weapon = CreateClientConVar("log_weapon", 1, true, false)
    local LOG_Team = CreateClientConVar("log_team", 1, true, false)
    local LOG_Spray = CreateClientConVar("log_spray", 1, true, false)
    local LOG_Plyuse = CreateClientConVar("log_plyuse", 1, true, false)
    local LOG_Noclip = CreateClientConVar("log_noclip", 1, true, false)
    local LOG_Chat = CreateClientConVar("log_chat", 1, true, false)
    
    local databaseObject = mysqloo.connect(DATABASE_HOST, DATABASE_USERNAME, DATABASE_PASSWORD, DATABASE_NAME, DATABASE_PORT)
    databaseObject:connect()
    
    /*--------------------------------------------------------------------------
    	Log: Player Connected
    */------------------------------------------------ -------------------------
    local function LogSqlConnect( name, ip )
    	if LOG_Connect:GetInt() == 1 then
    		local PlyNickConnect = name
    		local ConnectInfo = databaseObject:escape("[LOG] " .. PlyNickConnect .. " joined the server ( " .. ip .. " )" )
    		local Query = databaseObject:query("INSERT INTO logs (id, log, entered_time) VALUES(0, '" .. ConnectInfo .. "' , NOW())")
    		Query:start()
    	end
    end
    hook.Add("PlayerConnect", "LogSqlConnect", LogSqlConnect)
    
    /*--------------------------------------------------------------------------
    	Log: Player Spawned
    */------------------------------------------------ -------------------------
    local function LogSqlInitialSpawn( ply )
    	if LOG_Spawn:GetInt() == 1 then
    		local PlyNickInitialSpawn = ply:Nick()
    		local PlySteamId = ply:SteamID()
    		local InitialSpawnInfo = databaseObject:escape("[LOG] " .. PlyNickInitialSpawn .. " [" .. PlySteamId .. "] has spawned in the server." )
    		local Query = databaseObject:query("INSERT INTO logs (id, log, entered_time) VALUES(0, '" .. InitialSpawnInfo .. "' , NOW())");
    		Query:start()
    	end
    end
    hook.Add("PlayerInitialSpawn", "LogSqlInitialSpawn", LogSqlInitialSpawn)
    
    /*--------------------------------------------------------------------------
    	Log: Player Died
    */------------------------------------------------ -------------------------
    local function LogSqlDeath( ply, attacker, dmginfo )
    	if LOG_Death:GetInt() == 1 then
    		if attacker:IsValid() and attacker:IsPlayer() then
    			local PlyNick = ply:Nick()
    			local AttackPly = attacker:Nick()
    			local PlySteamId = ply:SteamID()
    			local AttackerSteamId = attacker:SteamID()
    			local PlyDeath = databaseObject:escape("[LOG] " .. PlyNick .. " [" .. PlySteamId .. "] has died. He was killed by " .. AttackPly .. " [" .. AttackerSteamId .. "]")
    			local Query = databaseObject:query("INSERT INTO logs (id, log, entered_time) VALUES(0, '" .. PlyDeath .. "' , NOW())");
    			Query:start()
    		end
    	end
    end
    hook.Add("DoPlayerDeath", "LogSqlDeath", LogSqlDeath)
    
    /*--------------------------------------------------------------------------
    	Log: Player Disconnected
    */------------------------------------------------ -------------------------
    local function LogSqlLeave( ply )
    	if LOG_Disconnect:GetInt() == 1 then
    		local PlyNick = ply:Nick()
    		local PlySteamId = ply:SteamID()
    		local PlyLeave = databaseObject:escape("[LOG] " .. PlyNick .. " [" .. PlySteamId .. "] has left the server.")
    		local Query = databaseObject:query("INSERT INTO logs (id, log, entered_time) VALUES(0, '" .. PlyLeave .. "' , NOW())" );
    		Query:start()
    	end
    end
    hook.Add("PlayerDisconnected", "LogSqlLeave", LogSqlLeave)
    
    /*--------------------------------------------------------------------------
    	Log: Player Spawned A Prop
    */------------------------------------------------ -------------------------
    local function LogSqlSpawnProp( ply, model, ent )
    	if LOG_Propspawn:GetInt() == 1 then
    		local PlyNick = ply:Nick()
    		local PlySteamId = ply:SteamID()
    		local PlyPropSpawn = databaseObject:escape("[LOG] " .. PlyNick .. " [" .. PlySteamId .. "] has spawned " .. model )
    		local Query = databaseObject:query("INSERT INTO logs (id, log, entered_time) VALUES(0, '" .. PlyPropSpawn .. "' , NOW())" );
    		Query:start()
    	end
    end
    hook.Add("PlayerSpawnedProp", "LogSqlSpawnProp", LogSqlSpawnProp)
    
    /*--------------------------------------------------------------------------
    	Log: Player Picked Up Weapon
    */------------------------------------------------ -------------------------
    local DontLog = {
    "weapon_crowbar",
    "weapon_pistol",
    "weapon_smg1",
    "weapon_frag",
    "weapon_physcannon",
    "weapon_crossbow",
    "weapon_shotgun",
    "weapon_357",
    "weapon_rpg",
    "weapon_ar2",
    "gmod_tool",
    "gmod_camera",
    "weapon_physgun",
     }
    
    local function LogSqlWeapon( ply, weapon )
    	if LOG_Weapon:GetInt() == 1 then
    		if !table.HasValue(DontLog , weapon:GetClass()) then
    			local PlyName = ply:Nick()
    			local Weapon = weapon:GetClass()
    			local PlySteamId = ply:SteamID()
    			local PlyPickUpweapon = databaseObject:escape("[LOG] " .. PlyName .. " [" .. PlySteamId .. "] picked up " .. Weapon )
    			local Query = databaseObject:query("INSERT INTO logs (id, log, entered_time) VALUES(0, '" .. PlyPickUpweapon .. "' , NOW())" );
    			Query:start()
    		end
    	end
    end
    hook.Add( "PlayerCanPickupWeapon", "LogSqlWeapon", LogSqlWeapon )
    
    /*--------------------------------------------------------------------------
    	Log: Player Joined Team
    */------------------------------------------------ -------------------------
    local function LogSqlJoinTeam( ply, teamid )
    	if LOG_Team:GetInt() == 1 then
    		local PlyNick = ply:Nick()
    		local PlyTeam =  team.GetName(teamid)
    		local PlySteamId = ply:SteamID()
    		local PlyJoinTeam = databaseObject:escape("[LOG] " .. PlyNick .. " [" .. PlySteamId .. "] joined team " .. PlyTeam )
    		local Query = databaseObject:query("INSERT INTO logs (id, log, entered_time) VALUES(0, '" .. PlyJoinTeam .. "' , NOW())" );
    		Query:start()
    	end
    end
    hook.Add( "PlayerJoinTeam", "LogSqlJoinTeam", LogSqlJoinTeam )
    
    /*--------------------------------------------------------------------------
    	Log: Player Sprayed Spray
    */------------------------------------------------ -------------------------
    local function LogSqlSprayed( ply )
    	if LOG_Spray:GetInt() == 1 then
    		local PlyNick = ply:Nick()
    		local PlySteamId = ply:SteamID()
    		local PlySprayed = databaseObject:escape("[LOG] " .. PlyNick .. " [" .. PlySteamId .. "] sprayed a spray.")
    		local Query = databaseObject:query("INSERT INTO logs (id, log, entered_time) VALUES(0, '" .. PlySprayed .. "' , NOW())" );
    		Query:start()
    	end
    end
    hook.Add( "PlayerSpray", "LogSqlSprayed", LogSqlSprayed )
    
    /*--------------------------------------------------------------------------
    	Log: Player Used Entity
    */------------------------------------------------ -------------------------
    local function LogSqlPlayerUse( ply, ent )
    	if LOG_Plyuse:GetInt() == 1 then
    		local PlyNick = ply:Nick()
    		local PlySteamId = ply:SteamID()
    		local PlyUsed = databaseObject:escape("[LOG] " .. PlyNick .. " [" .. PlySteamId .. "] used " .. ent:GetClass() )
    		local Query = databaseObject:query("INSERT INTO logs (id, log, entered_time) VALUES(0, '" .. PlyUsed .. "' , NOW())" );
    		Query:start()
    	end
    end
    hook.Add( "PlayerUse", "LogSqlPlayerUse", LogSqlPlayerUse )
    
    /*--------------------------------------------------------------------------
    	Log: Player Used Noclip
    */------------------------------------------------ -------------------------
    local function LogSqlPlayerNocliped( ply )
    	if LOG_Noclip:GetInt() == 1 then
    		local PlyNick = ply:Nick()
    		local PlySteamId = ply:SteamID()
    		local PlyNoclip = databaseObject:escape("[LOG] " .. PlyNick .. " [" .. PlySteamId .. "] used noclip. ")
    		local Query = databaseObject:query("INSERT INTO logs (id, log, entered_time) VALUES(0, '" .. PlyNoclip .. "' , NOW())" );
    		Query:start()
    	end
    end
    hook.Add( "PlayerNoClip", "LogSqlPlayerNocliped", LogSqlPlayerNocliped )
    
    /*--------------------------------------------------------------------------
    	Log: Player said
    */------------------------------------------------ -------------------------
    local function LogSqlChat( ply, text )
    	if LOG_Chat:GetInt() == 1 then  
    		local PlyNick = ply:Nick()  
    		local PlyChat = databaseObject:escape(PlyNick .. ": " .. text)  
    		if ply:Alive() then  
    			local Query = databaseObject:query("INSERT INTO logs (id, log, entered_time) VALUES(0, '" .. PlyChat .. "' , NOW())");
    			Query:start()
    		else  
    			local Query = databaseObject:query("INSERT INTO logs (id, log, entered_time) VALUES(0, '" .. "*DEAD* " .. PlyChat .. "' , NOW())");
    			Query:start()
    		end 
    	end
    end  
    hook.Add("PlayerSay", "LogSqlChat", LogSqlChat )  
    
    Reply With Quote Edit / Delete Denmark Show Events