Jump to content
×
×
  • Create New...
  • 0

Server_timer PROBLEM


mafianekcek

Question

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

2 answers to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


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.