1. Post #1
    Gold Member
    LedZepp's Avatar
    June 2012
    233 Posts
    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:
    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)
    
    Please help!

    Edited:

    ill pay $5-$10 for whoever can do it :P

    Edited:

    Add me on steam for any questions

  2. Post #2
    RUBY OVERLORD
    swift and shift's Avatar
    November 2011
    2,115 Posts
    result3 = sql.Query("SELECT status FROM darkrp_wallets WHERE status = 'NULL'")

    i think you want

    result3 = sql.Query("SELECT status FROM darkrp_wallets WHERE status IS NULL")
    Reply With Quote Edit / Delete Reply Mac Australia Show Events Agree Agree x 3 (list)

  3. Post #3
    Chesnut's Avatar
    July 2011
    49 Posts
    Typo on line 4.
    Reply With Quote Edit / Delete Reply Windows 7 Estonia Show Events Dumb Dumb x 2 (list)

  4. Post #4

    July 2007
    864 Posts
    Added you.