• Small job[LUA, MySQL]
    3 replies, posted
  • Avatar of LedZepp
  • Ok now I have my code all situated and things but for some reason the code doesn't seem to want to work. If someone can tell me at least what is wrong it would really be appreciated. Oh and I'm not too familiar with MySQL. Here is what I have so far: [lua]AddCSLuaFile("_MYSQL.lua") include("_MYSQL.lua") function Initialiize() player_donated() end function player_donated ( ply ) ( steamID = sql.Query("SELECT steam FROM darkrp_wallets") result = sql.Query("SELECT status FROM darkrp_wallets WHERE status = 'admin'") result2 = sql.Query("SELECT status FROM darkrp_wallets WHERE status = 'donator'") result3 = sql.Query("SELECT status FROM darkrp_wallets WHERE status = 'NULL'") if (result) then RunConsoleCommand("ulx adduserid " ..steamID.. " admin ") // Call command to make person admin elseif (result2) then // If the value isnt admin then make them supporter RunConsoleCommand("ulx adduserid " ..steamID.. " supporter ") end) end function Check( ply ) if ply:IsAdmin() then print("You Are Already Admin!") return end end hook.Add( "PlayerInitialSpawn", "PlayerInitialSpawn", PlayerInitialSpawn ) hook.Add( "Checkforsql", "Check", Check ) hook.Add( "Initialize", "Initialize", Initialize) [/lua] Please help! [editline]21st June 2012[/editline] ill pay $5-$10 for whoever can do it :P [editline]21st June 2012[/editline] Add me on steam for any questions
  • Avatar of swift and shift
  • [lua]result3 = sql.Query("SELECT status FROM darkrp_wallets WHERE status = 'NULL'")[/lua] i think you want [lua]result3 = sql.Query("SELECT status FROM darkrp_wallets WHERE status IS NULL")[/lua]