Jump to content

Question about code quest


Recommended Posts

  • Bronze

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
Share on other sites

  • 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

 

This is the hidden content, please

Taken from here:

  • Metin2 Dev 1
  • Good 1
  • Love 2
Link to comment
Share on other sites

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
Share on other sites

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
Share on other sites

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
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • 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.