I am creating report system using quest. I created new function and quest.
But when I use that quest, it inputs my name ("who") into "reported" column.. And "reported" text is nowhere..
quest(it is only testing quest):
quest report_button begin
state start begin
when letter begin
cmdchat("report_button "..q.getcurrentquestindex())
end
when button or info begin
local who = pc.get_name()
local reported = "Make DDS!"
report_log(who, reported)
syschat("DEBUG COMPLETE")
end
end
end
It is calling function report_log, which I created.. There is function:
questlua_global.cpp:
int _report_log(lua_State * L)
{
CQuestManager& q = CQuestManager::instance();
const char* who = "";
const char* reported = "";
if (lua_isstring(L, 1)) who = lua_tostring(L, 1);
if (lua_isstring(L, 2)) reported = lua_tostring(L, 2);
LogManager::instance().ReportLog(who, reported);
return 0;
}
quest report_button begin state start begin when letter begin cmdchat("report_button "..q.getcurrentquestindex()) end when button or info begin local who = pc.get_name() local reported = "Make DDS!" report_log(who, reported) syschat("DEBUG COMPLETE") end end end
It is calling function report_log, which I created.. There is function:
questlua_global.cpp:
int _report_log(lua_State * L) { CQuestManager& q = CQuestManager::instance(); const char* who = ""; const char* reported = ""; if (lua_isstring(L, 1)) who = lua_tostring(L, 1); if (lua_isstring(L, 2)) reported = lua_tostring(L, 2); LogManager::instance().ReportLog(who, reported); return 0; }
And this function is called by "ReportLog"
log.cpp:
void LogManager::ReportLog(const char* who, const char* reported) { Query("INSERT DELAYED INTO report (who, reported) VALUES('%s', '%s');", get_table_postfix(), who, reported); }
Could somebody help me, please? :/
Share this post
Link to post
Share on other sites