Jump to content

Manyak

Members
  • Content Count

    3
  • Joined

  • Last visited

  1. OnEventStart: if (!getvariableofnpc(.Enable_DailyMob, "settings")) end; do { set .i_MonsterId, callfunc("GetRandMob"); } while (getmonstername(.i_MonsterId) == "null"); set .@sql, query_sql("UPDATE `char_reg_num_db` SET `value` = '0' WHERE `key` = 'HuntCount'"); if (.@sql) { announce "The Daily Monster is " + getmonstername(.i_MonsterId)", bc_all; set .b_DailyMonsterIsRunning, 1; } else debugmes "[OnEventStart] - Query sql failed."; end; And this is what call my event 'OnEventStart': OnMinute25: if (gettime(3) == 10 || gettime(3) == 16 || gettime(3) == 22) donpcevent strnpcinfo(0)+"::OnEventStart"; else if (gettime(3) == 12 || gettime(3) == 18 || gettime(3) == 0) donpcevent strnpcinfo(0)+"::OnEventEnd"; end; I used to bind a command to skip waiting 10:25, 16:25 or 22:25. OnInit: bindatcmd(strnpcinfo(0), strnpcinfo(0)+"::OnEventStart", 99, 99); end; I still have no error or debugmes on my map-server. Thank you for helping me sir, Many. Edit: I made this script, cause I wanna see if I made a mistake. Try it: - script test -1,{ end; OnInit: bindatcmd(strnpcinfo(0), strnpcinfo(0)+"::OnEventStart"); bindatcmd(strnpcinfo(0)+"2", strnpcinfo(0)+"::OnEventEnd"); end;OnEventStart: set HuntCount, HuntCount + 1; dispbottom "OnEventStart: [" + HuntCount + "]"; end; OnEventEnd: set .@sql, query_sql("UPDATE `char_reg_num_db` SET `value` = '0' WHERE `key` = 'HuntCount'"); //query_sql "UPDATE `char_reg_num_db` SET `value` = '0' WHERE `key` = 'HuntCount'", @sql; //Doesn't work either dispbottom "OnEventEnd: [" + HuntCount + "]"; end;} In each case, .@sql and @sql are both equal to 0.
  2. Hello guys, I have an unexpected error, and I hope you can help me. I can't update `char_reg_num_db` with a query_sql. set .@sql, query_sql("UPDATE `char_reg_num_db` SET `value` = '0' WHERE `key` = 'HuntCount'"); The map-server show me no error, but my table is not updated. I worked on this all day long, and now I have no idea why this query doesn't update my table correctly. Thank you for your help.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.