Jump to content
×
×
  • Create New...
  • 0

Question about code quest


xxx30xxx

Question

12 answers to this question

Recommended Posts

  • 0
  • Moon

You need to add this to your source.

and then start using it :)

 

mysql_direct_query("UPDATE account.account SET gold_expire=_DATE_, silver_expire=_DATE_ WHERE id=_ID_")

 

LINK !!!

http://www.elitepvpers.com/forum/metin2-pserver-guides-strategies/3327940-release-mysql_direct_query-get_table_postfix-mysql_escape_string-written-c-lua.html

  • Love 1
Link to comment
  • 0
  • Premium

Here has the following functions in C ++

 

mysql.query
mysql.direct_query
mysql.update
mysql.real_escape_string
mysql.get_table_postfix

 

go to game / src

 

open queslua.cpp

 

under

RegisterDragonSoulFunctionTable();

add

RegisterMysqlFunctionTable();

open queslua.h

 

under

extern void RegisterDragonSoulFunctionTable();

add

extern void RegisterMysqlFunctionTable();

add in the makefile 

questlua_mysql.cpp

Download the file

 

Hidden Content

    Give reaction to this post to see the hidden content.

Taken from here:

  • Love 1
Link to comment
  • 0

guys i'm sorry but i mean how i use date in this function 

 

mysql_direct_query("UPDATE account.account SET gold_expire=_DATE_, silver_expire=_DATE_ WHERE id=_ID_")

 

I need to add 7 days to one of the accounts

 

If he are using this tool 40004

 

I'm sorry, I'm not good in English

 

Thank you everyone

Link to comment
  • 0

guys i do this but not work

 

quest point_add begin
	state start begin
	    function exp_point_add(x)
	        mysql_direct_query("UPDATE account.account SET gold_expire=DATE() + "..(get_time() + x*60*60*24).." WHERE id='"..pc.get_account_id().."")
        end
		when 40004.use begin
		    point_add.exp_point_add(7)
			say(" add 7 days gold  ")
		end
	end
end

can anyone help me?

Link to comment
  • 0
quest gold_expire_update begin
	state start begin
		when 40004.use begin	--- vnum item used for update gold_expire
			local c,query = mysql_direct_query("SELECT * FROM account.account WHERE id = '"..pc.get_account_id().."' LIMIT 1;")
			if query[1].gold_expire  == '0000-00-00 00:00:00' then
				mysql_direct_query("UPDATE account.account SET gold_expire = ADDDATE(NOW(), 7) WHERE id = '"..pc.get_account_id().."';")
			else
				mysql_direct_query("UPDATE account.account SET gold_expire = ADDDATE(gold_expire, 7) WHERE id = '"..pc.get_account_id().."';")
			end
			pc.remove_item(40004, 1)
		end
	end
end
  • Love 2
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


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.