• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Problem z Bug Trackerem

zielas

New Member
Joined
Sep 4, 2010
Messages
14
Reaction score
0
Mam problem z tym Bug trackerem: http://tibia.net.pl/threads/560653-Bug-Tracker-System-RPG

Oto błąd po wpisaniu komendy !bug, na default wyświetla się ten napis: 12:32 Your request has been sent. a w konsoli:

Code:
[15/12/2013 12:33:32] [Error - TalkAction Interface]
[15/12/2013 12:33:32] data/talkactions/scripts/bugtracker.lua:onSay
[15/12/2013 12:33:32] Description:
[15/12/2013 12:33:32] data/talkactions/scripts/bugtracker.lua:31: attempt to call field 'query' (a nil value)
[15/12/2013 12:33:32] stack traceback:
[15/12/2013 12:33:32] data/talkactions/scripts/bugtracker.lua:31: in function <data/talkactions/scripts/bugtracker.lua:1>

Na kanale Bug Tracker nic się nie pojawia. Dzięki za pomoc :)

Skrypt z Talkactions:

Code:
function onSay(cid, words, param, channel)

local storage = 193728

local seconds = 40

local position_player = getPlayerPosition(cid)



if(param == '') then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have to write here your message to administration.")

return true

end



if exhaustion.get(cid, storage) then

pause = math.floor(((exhaustion.get(cid, storage)) + 1))

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have to wait "..pause.." seconds to be able report next bug.")

return true

end

db.query("INSERT INTO `bug_tracker_ingame` (`id_bug`, `name`, `description`, `posx`, `posy`, `posz`, `time`) VALUES (null, '"..getPlayerName(cid).."', '"..db.escapeString(param).."', "..position_player.x..", "..position_player.y..", "..position_player.z..", "..os.date("%Y", times)..""..os.date("%m", times)..""..os.date("%d", times).." );")

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your request has been sent.")

exhaustion.set(cid, storage, seconds)



local target = db.getResult("SELECT `name`, `id_bug`, `description`, `posx`, `posy`, `posz` FROM `bug_tracker_ingame` ORDER BY `id_bug` DESC LIMIT 1")



if(target:getID() == -1) then

return true

end



local nickGracza = target:getDataString("name")

local idGracza = target:getDataInt("id_bug")

local desc = target:getDataString("description")

local x = target:getDataInt("posx")

local y = target:getDataInt("posy")

local z = target:getDataInt("posz")

target:free()



for _, pid in ipairs(getPlayersOnline()) do

if getPlayerAccess(pid) > 3 then

doPlayerOpenChannel(pid, 10)

addEvent(doPlayerSendChannelMessage, 500, pid, "Bug Tracker System" , "\n Nr. Zgłoszenia: " .. idGracza .." \n Nick Gracza: " .. nickGracza .. "\n Opis błędu: "..desc .." \n Pozycja gracza: ".. x ..", ".. y ..", ".. z .." \n Data: "..os.date("%x", times).." "..os.date("%X", times).."", TALKTYPE_CHANNEL_O, 10)

end

end

return true

end
 
Spróbuj pozamieniać wystąpienia:
Code:
db.query
Na:
Code:
db.executeQuery

Ponadto dobrym pomysłem byłoby podanie wersji i typu silnika z którego korzystasz.
 
TFS 0.3.6, Client 8.54.

Edit: Zmieniłem tak jak napisałeś i teraz mam taki bład:

Code:
mysql_real_query(): INSERT INTO `bug_tracker_ingame` (`id_bug`, `name`, `description`, `posx`, `posy`, `posz`, `time`) VALUES (null, 'Zielas', ''test'', 1022, 1055, 7, 20131222  ); - MYSQL ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'test'', 1022, 1055, 7, 20131222  )' at line 1 (1064)
 
@Up, w skrypcie ta linijka wygląda tak:
Code:
db.executeQuery("INSERT INTO `bug_tracker_ingame` (`id_bug`, `name`, `description`, `posx`, `posy`, `posz`, `time`) VALUES (null, '"..getPlayerName(cid).."', ""..db.escapeString(param).."', "..position_player.x..", "..position_player.y..", "..position_player.z..", "..os.date("%Y", times)..""..os.date("%m", times)..""..os.date("%d", times).."  );")

Błąd, który podałem w poprzednim poście pojawił się po wpisaniu komendy na serwerze "!bug test".

Tamten błąd chyba udało mi się rozwiązać, teraz mam coś takiego, problem z funckją:

Code:
[22/12/2013 15:59:12] [Error - TalkAction Interface]
[22/12/2013 15:59:12] data/talkactions/scripts/bugtracker.lua:onSay
[22/12/2013 15:59:12] Description:
[22/12/2013 15:59:12] data/talkactions/scripts/bugtracker.lua:71: attempt to call global 'doPlayerOpenChannel' (a nil value)
[22/12/2013 15:59:12] stack traceback:
[22/12/2013 15:59:12]    data/talkactions/scripts/bugtracker.lua:71: in function <data/talkactions/scripts/bugtracker.lua:1>
 
doPlayerOpenChannel to funkcja otwierająca channel

luascript.h
Code:
static int32_t luaDoPlayerOpenChannel(lua_State* L);

luascript.cpp
Code:
//doPlayerOpenChannel(cid, channelId)
lua_register(m_luaState, "doPlayerOpenChannel", LuaScriptInterface::luaDoPlayerOpenChannel);
Code:
int32_t LuaScriptInterface::luaDoPlayerOpenChannel(lua_State* L)
{
//doPlayerOpenChannel(cid, channelId)
uint32_t channelId = popNumber(L);
uint32_t cid = popNumber(L);

ScriptEnviroment* env = getScriptEnv();
Player* player = env->getPlayerByUID(cid);
if(player)
lua_pushnumber(L, g_game.playerOpenChannel(cid, channelId) ? true : false);
else
{
reportErrorFunc(getErrorDesc(LUA_ERROR_PLAYER_NOT_FOUND));
lua_pushnumber(L, false);
}
return 1;
}

nie jestem pewny czy tak jak nie zadziała to wytne ci z mojego silnika później dokładniej bo teraz jestem po formacie ;p
 
Back
Top