farkmt2official 1
farkmt2official
Mt2Hizmet 1
Mt2Hizmet
Bvural41 1
Bvural41
berzahx 1
berzahx
mavzermete 1
mavzermete
Hikaye Ekle

Lua İçin Zaman Uyarlaması

Ayyıldız2 | 2008 TR Yapısı • 1-99 Orta Emek Destan • Oto Avsız • 10 Temmuz 21:00 HEMEN TIKLA!

Kod:
service.h

ekle:



#define ENABLE_LUA_FUNCTION_TIME



questlua_global.cpp aç:



Arat:

    void RegisterGlobalFunctionTable(lua_State * L)



Üstüne ekle:



#ifdef ENABLE_LUA_FUNCTION_TIME

    #include <time.h>       /* time_t, struct tm, time, localtime */



    ALUA(_print_datetime)

    {

        time_t currentTime;

        struct tm *localTime;

      

        time(&currentTime);

        localTime = localtime(&currentTime);

        CQuestManager::Instance().GetCurrentCharacterPtr()->ChatPacket(CHAT_TYPE_NOTICE, "%s", asctime(localTime));

        return 0;

    }

#endif





Arat:

            {nullptr, nullptr    }

        };



Üstüne ekle:

#ifdef ENABLE_LUA_FUNCTION_TIME

            {"print_datetime", _print_datetime},

#endif
 
Kod:
service.h

ekle:



#define ENABLE_LUA_FUNCTION_TIME



questlua_global.cpp aç:



Arat:

    void RegisterGlobalFunctionTable(lua_State * L)



Üstüne ekle:



#ifdef ENABLE_LUA_FUNCTION_TIME

    #include <time.h>       /* time_t, struct tm, time, localtime */



    ALUA(_print_datetime)

    {

        time_t currentTime;

        struct tm *localTime;

     

        time(&currentTime);

        localTime = localtime(&currentTime);

        CQuestManager::Instance().GetCurrentCharacterPtr()->ChatPacket(CHAT_TYPE_NOTICE, "%s", asctime(localTime));

        return 0;

    }

#endif





Arat:

            {nullptr, nullptr    }

        };



Üstüne ekle:

#ifdef ENABLE_LUA_FUNCTION_TIME

            {"print_datetime", _print_datetime},

#endif
Paylaşım için teşekkürler.
 

Şu an konuyu görüntüleyenler (Toplam : 0, Üye: 0, Misafir: 0)

Geri
Üst