Jump to content

Recommended Posts

Good afternoon everyone, can anyone help me with this problem, I would like to know why this quest is not working, I open it ingame and nothing happens.

 

quest point_exchange begin
    state start begin
        when 20082.chat."Consult Kill Points" begin
            syschat("Checking your kill points...")

            -- Querying the number of points in the ranking_de_kills column
            localresult_kills = mysql_query("SELECT ranking_de_kills FROM player WHERE id = "..pc.get_player_id())
            ifresult_kills then
                local Pontos_kills = tonumber(resultado_kills[1]) or 0
                syschat("You have " .. kill_points .. " kill points.")
            else
                syschat("Error querying kill points.")
            end
        end
    end
end

 

Link to comment
https://metin2.dev/topic/32956-question-mysql-query/
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

  • Active+ Member

Try this: 

 

quest point_exchange begin
    state start begin
        when 20082.chat."Consult Kill Points" begin
            syschat("Checking your kill points...")

            -- Querying the number of points in the ranking_de_kills column
            local result_kills = mysql_query("SELECT ranking_de_kills FROM player WHERE id = "..pc.get_player_id())
            
            if result_kills then
                local Pontos_kills = tonumber(result_kills[1]) or 0
                syschat("You have " .. Pontos_kills .. " kill points.")
            else
                syschat("Error querying kill points.")
            end
        end
    end
end

is untested tho. 

 

however, you have a lot of typos in it. 

resultado_kills[1] should be localresult_kills[1] to match the variable used earlier (localresult_kills). 

kill_points is not defined in your script. You likely intended to use Pontos_kills here instead.

ifresult_kills then: was wrong. 

 

Edited by KolenMG
Link to comment
https://metin2.dev/topic/32956-question-mysql-query/#findComment-166888
Share on other sites

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.