-
Posts
236 -
Joined
-
Last visited
-
Days Won
1 -
Feedback
0%
Content Type
Forums
Store
Third Party - Providers Directory
Feature Plan
Release Notes
Docs
Events
Posts posted by ATAG
-
-
chat(totalX[1][1])
returns an indexed table. totalX[1] is the forst row, totalX[2] is 2nd, etc...
[1][1] is the first column in first roe, [1][2] is 2nd etc...
-
Try this one, maybe you get some information:
function mysql_query(text) local tmp=number(11111111,99999999) os.execute('mysql -u root -pPASSWORD -N -e '..string.format("%q",text)..' 2>&1 > /tmp/'..tmp) local res,i={},1 local f,e=io.open("/tmp/"..tmp) if f then local line=f:read("*l") while line do res[i]={} string.gsub(line,"([^t]+)t*", function(s) table.insert(res[i],s) end) i=i+1 line=f:read("*l") end f:close() os.execute("rm /tmp/"..tmp) else res[1] = {(e or "WTF??")} end return res end
or remove the os.execute("rm /tmp/"..tmp) and check the random number named file in /tmp
-
What is the output if you enter the command directly into console?
mysql -u root -p -N -e "SELECT id, account_id, name from player.player LIMIT 10;"- 1
-
You don't have drop_gamble_with_flag function. Add this to questlib.lua:
function get_today_count(questname, flag_name) local today = math.floor(get_global_time() / 86400) local today_flag = flag_name.."_today" local today_count_flag = flag_name.."_today_count" local last_day = pc.getf(questname, today_flag) if last_day == today then return pc.getf(questname, today_count_flag) else return 0 end end -- "$flag_name"_today unix_timestamp % 86400 -- "$flag_name"_count count function inc_today_count(questname, flag_name, count) local today = math.floor(get_global_time() / 86400) local today_flag = flag_name.."_today" local today_count_flag = flag_name.."_today_count" local last_day = pc.getqf(questname, today_flag) if last_day == today then pc.setf(questname, today_count_flag, pc.getf(questname, today_count_flag) + 1) else pc.setf(questname, today_flag, today) pc.setf(questname, today_count_flag, 1) end end -- This function will return true always in window os, -- but not in freebsd. -- (In window os, RAND_MAX = 0x7FFF = 32767.) function drop_gamble_with_flag(drop_flag) local dp, range = pc.get_killee_drop_pct() dp = 40000 * dp / game.get_event_flag(drop_flag) if dp < 0 or range < 0 then return false end return dp >= number(1, range) end
- 3
-
Are your map2 and arena on the same gamecore? (because they must be)
- 3
-
-
Some mysqlclient version requires single dash, others need double dashes in the mysql options.
-
os.execute ([command])
This function is equivalent to the ANSI C function system. It passes command to be executed by an operating system shell. Its first result is true if the command terminated successfully, or nil otherwise. After this first result the function returns a string and a number, as follows:
"exit": the command terminated normally; the following number is the exit status of the command."signal": the command was terminated by a signal; the following number is the signal that terminated the command.
When called without a command, os.execute returns a boolean that is true if a shell is available.
You have to use a mysql_query function...
eg:
function mysql_query(text) local tmp=number(11111111,99999999) os.execute('mysql -u root -pPASSWORD -N -e '..string.format("%q",text)..' 2>&1 > /tmp/'..tmp) local res,i={},1 local f,e=io.open("/tmp/"..tmp) if f then local line=f:read("*l") while line do res[i]={} string.gsub(line,"([^t]+)t*", function(s) table.insert(res[i],s) end) i=i+1 line=f:read("*l") end f:close() os.execute("rm /tmp/"..tmp) end --[[if table.getn(res)==1 and table.getn(res[1])==1 then --only 1 variable returns res=res[1][1] end]] return res end
And how-to use in quest:
--by ATAG quest sqltest begin state start begin when 20016.chat."test list" begin local tbl=mysql_query("SELECT id, account_id, name from player.player LIMIT 10;") say("userlist: "..table.getn(tbl)) for i,v in ipairs(tbl) do say(v[1].." "..v[2].." "..v[3]) end say("") end end end
-
To change "oldstring" to "newstring" in all CONFIG files, just type:
grep -rl oldstring CONFIG | xargs sed -i -e 's/oldstring/newstring/'
- 1
-
Don't use novaline game, because it is not compatible with novaline client (r28).
Use mainline instead...
-
Hi!
I don't know if it is a perfect solution, but it works fine for me.
Open game/char_item.cpp and find this:
if (false == CanUnequipNow(item2) || false == CanEquipNow(item1))
Replace to this:
//if (false == CanUnequipNow(item2) || false == CanEquipNow(item1)) if (false == CanEquipNow(item1)) return false; if (item2->IsDragonSoul() && false == CanUnequipNow(item2)) return false;
Then compile and run...
- 21
-
You have to add at least one say("") after wait(). And i prefer to use
when 9009.chat."vip" with string.sub(pc.name,1,5) == "[VIP]" begin
-
Then make a "export LD_LYBRARY_PATH=/usr/local/lib32/metin2" before start the server. It helped me on 9.1 x86
-
Version 2.4
1.) upload every file in the lib-directory to /usr/local/lib32/metin2
If this folder does not exist, create it!
It's included in the game archive...
-
Packet.h is just a little part of the protocol, look at this: http://metin2dev.org/board/topic/191-cgame-client-client-game-communication-with-packets/
- 1
-
It seems like your root pack is bugged.
-
Is there any information in syserr.txt?
-
Compile the game with the -static CFLAG
The only thing you need before is to add -ljbig -llzma AFTER -ltiff in Makefile -
Or use the search function in the forum: http://metin2dev.org/board/topic/932-how-to-disable-item-prism-71113/
-
Unfortunetly Vannila core doesn't have this function (yet).
-
You don't have get_special_item_group function in the game file, try to use a more recent version.
-
Why do you want to change anything, if everything seems to be working?
- 1
-
Not sure to undestand my english is bad.. want remove all hair from player? if yes, try from db with sql like
update player.player set part_hair = '0' where part_hair >= '1'
if the question is another sry
That`s the problem ... i set manualy and by query and the old part_hair apears again and again and again when i use bersek or mount & horse..
Do you modify the database when the server is off? What db/game versin do you use?
-
Just a note: on FreeBSD 9.1 i set the LD_LIBRARY_PATH to /usr/lib32/metin2 and db/game starts perfectly now.
PROBLEM WITH QUEST
in Community Support - Questions & Answers
Posted
Try notice_in_map("my notice", 1)
Second argument is 0 or 1 (false/true) means BIG_NOTICE (maybe)