Jump to content

Server_timer PROBLEM


Recommended Posts

Hello guys, i have problem with server_timer or server_loop_timer, It do not make no signal, it dont work and game going crash after 1 second.
QUEST:

quest server_timer begin
    state start begin
        when 9003.chat."srv_timer" begin
            server_timer("shit", 1, pc.get_map_index())
            --server_timer("shit", 1)
            say("You have now server timer apply.")
        end
        when shit.server_timer begin
            chat("ok")
        end
    end
end


But after 1 second it dont do nothing, when i use only server_timer("shit", 1) too not work, but when i change server_timer to only timer, it works perfect, but i need use server_timer for dungeons.
SOURCE CODE:

int _set_server_timer(lua_State* L)
{
    int n = lua_gettop(L);
    if ((n != 2 || !lua_isnumber(L, 2) || !lua_isstring(L, 1)) &&
    (n != 3 || !lua_isstring(L, 1) || !lua_isnumber(L, 2) || !lua_isnumber(L, 3)))
    {
        sys_err("QUEST set_server_timer argument count wrong.");
        return 0;
    }

    const char * name = lua_tostring(L, 1);
    double t = lua_tonumber(L, 2);
    DWORD arg = 0;

    CQuestManager & q = CQuestManager::instance();

    if (lua_isnumber(L, 3))
    arg = (DWORD) lua_tonumber(L, 3);

    int timernpc = q.LoadTimerScript(name);

    LPEVENT event = quest_create_server_timer_event(name, t, timernpc, false, arg);
    q.AddServerTimer(name, arg, event);
    return 0;
}


Please, can somebody help me? Thank you.

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



  • Similar Content

  • Activity

    1. 5

      Effect weapons

    2. 3

      Crystal Metinstone

    3. 3

      Feeding game source to LLM

    4. 113

      Ulthar SF V2 (TMP4 Base)

    5. 3

      Feeding game source to LLM

    6. 0

      Target Information System

    7. 3

      Feeding game source to LLM

    8. 2

      anti exp explanation pls

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.