Ox Chat Engeli [C++, LUA]

Whistle

Ruhsuz :/
Kurucu
Geliştirici
Yardımsever Üye
Mesaj
12.062
Çözümler
571
Beğeni
14.471
Puan
5.915
Ticaret Puanı
2
Server/game/src/input_main.cpp açılır ve aratılır;
C++:
Genişlet Daralt Kopyala
int CInputMain::Chat(LPCHARACTER ch, const char * data, size_t uiBytes)
Altına şu kod eklenir:
C++:
Genişlet Daralt Kopyala
if (quest::CQuestManager::instance().GetEventFlag("ox_chat_engel") == 1)
{
    if(ch->GetMapIndex() == 113 && (pinfo->type == CHAT_TYPE_TALKING || pinfo->type == CHAT_TYPE_PARTY || pinfo->type == CHAT_TYPE_GUILD || pinfo->type == CHAT_TYPE_SHOUT))
    {
        ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ox konusmasi"));
        return iExtraLen;
    }
}

Lua kodları:
Lua (Quest):
Genişlet Daralt Kopyala
quest ox_chat begin    state start begin
        when 20358.chat."OX Chat Engel" with pc.is_gm() begin
            local durum = game.get_event_flag("ox_chat_engel")
            if durum == 0 then
                say("Chat engeli açmak istiyor musun?")
                say("")
                local ac = select(locale.yes,locale.no)
                if ac == 1 then
                    say("Chat engel aktif.")
                    game.set_event_flag("ox_chat_engel",1)
                end
            else
                say("Chat engeli kapamak istiyor musun?")
                say("")
                local ac = select(locale.yes,locale.no)
                if ac == 1 then
                    say("Chat engel deaktif.")
                    game.set_event_flag("ox_chat_engel",0)
                end
            end
        end
    end
end

Locale stringe ekleyin:
Kod:
Genişlet Daralt Kopyala
"ox konusmasi";
"|cffFFC125Ox mapinde yöneticiler izin vermediği sürece konusamazsın.";

Sistemin çalıştığına dair kanıt;
Ox Chat Engeli [C++, LUA].jpg
 
bu hatayı alıyorum nerde hata yapıyorum
1671274854979.webp
1671274907268.webp
 
İf koşulunu şu şekilde ekleyin;
C++:
Genişlet Daralt Kopyala
if (quest::CQuestManager::instance().GetEventFlag("ox_chat_engel") == 1)
{
    if(ch->GetMapIndex() == 113 && (pinfo->type == CHAT_TYPE_TALKING || pinfo->type == CHAT_TYPE_PARTY || pinfo->type == CHAT_TYPE_GUILD || pinfo->type == CHAT_TYPE_SHOUT))
    {
        ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ox konusmasi"));
        return iExtraLen;
    }
}
 
İf koşulunu şu şekilde ekleyin;
C++:
Genişlet Daralt Kopyala
if (quest::CQuestManager::instance().GetEventFlag("ox_chat_engel") == 1)
{
    if(ch->GetMapIndex() == 113 && (pinfo->type == CHAT_TYPE_TALKING || pinfo->type == CHAT_TYPE_PARTY || pinfo->type == CHAT_TYPE_GUILD || pinfo->type == CHAT_TYPE_SHOUT))
    {
        ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ox konusmasi"));
        return iExtraLen;
    }
}


Ox mapinde yöneticiler izin vermediği sürece konuşamazsın yazısı sınırsız tekrarlanıyor 1 sn arayla neden olabilir?

Gm hesabında sadece yazı yazarken bu uyarı geliyor ama oyuncu hesabından 1 sn de bir tekrarlanıyor yazmasa bile
 
Son düzenleme:
Ox mapinde yöneticiler izin vermediği sürece konuşamazsın yazısı sınırsız tekrarlanıyor 1 sn arayla neden olabilir?

Gm hesabında sadece yazı yazarken bu uyarı geliyor ama oyuncu hesabından 1 sn de bir tekrarlanıyor yazmasa bile
Yanlış yere eklenmiş olabilir kod blogunun tamamını atar mısın?
 
gm hesaplar konuşamıyor /b /n gibi komutlarda dahil sadece user hesaplara bu engeli yapmak için ne gibi kod yazmalıyız ?
 
gm hesaplar konuşamıyor /b /n gibi komutlarda dahil sadece user hesaplara bu engeli yapmak için ne gibi kod yazmalıyız ?
İf bloğunu şu şekilde değiştirip dene.
C++:
Genişlet Daralt Kopyala
if (quest::CQuestManager::instance().GetEventFlag("ox_chat_engel") == 1 && ch->GetGMLevel() == GM_PLAYER);
 
Son düzenleme:
C++:
Genişlet Daralt Kopyala
if (quest::CQuestManager::instance().GetEventFlag("ox_chat_engel") == 1)
{
    if(ch->GetMapIndex() == 113 && (pinfo->type == CHAT_TYPE_TALKING || pinfo->type == CHAT_TYPE_PARTY || pinfo->type == CHAT_TYPE_GUILD || pinfo->type == CHAT_TYPE_SHOUT))
    {
        if(ch->GetGMLevel() == GM_PLAYER)
        {       
            ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ox konusmasi"));
            return iExtraLen;
        }
    }
}

////////////////

if (quest::CQuestManager::instance().GetEventFlag("ox_chat_engel") == 1)
{
    if(ch->GetMapIndex() == 113 && (pinfo->type == CHAT_TYPE_TALKING || pinfo->type == CHAT_TYPE_PARTY || pinfo->type == CHAT_TYPE_GUILD || pinfo->type == CHAT_TYPE_SHOUT)
        &&     ch->GetGMLevel() == GM_PLAYER)
    {
        ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ox konusmasi"));
        return iExtraLen;
    }
}

İki türlü de deneyebilirsin.
 
C++:
Genişlet Daralt Kopyala
if (quest::CQuestManager::instance().GetEventFlag("ox_chat_engel") == 1)
{
    if(ch->GetMapIndex() == 113 && (pinfo->type == CHAT_TYPE_TALKING || pinfo->type == CHAT_TYPE_PARTY || pinfo->type == CHAT_TYPE_GUILD || pinfo->type == CHAT_TYPE_SHOUT))
    {
        if(ch->GetGMLevel() == GM_PLAYER)
        {      
            ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ox konusmasi"));
            return iExtraLen;
        }
    }
}

////////////////

if (quest::CQuestManager::instance().GetEventFlag("ox_chat_engel") == 1)
{
    if(ch->GetMapIndex() == 113 && (pinfo->type == CHAT_TYPE_TALKING || pinfo->type == CHAT_TYPE_PARTY || pinfo->type == CHAT_TYPE_GUILD || pinfo->type == CHAT_TYPE_SHOUT)
        &&     ch->GetGMLevel() == GM_PLAYER)
    {
        ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ox konusmasi"));
        return iExtraLen;
    }
}

İki türlü de deneyebilirsin.
c++:
Genişlet Daralt Kopyala
#ifdef ENABLE_OXCHATENGEL
    if (quest::CQuestManager::instance().GetEventFlag("ox_chat_engel") == 1)
    {
        if(ch->IsGM() == false)
        {
            if(ch->GetMapIndex() == 113 && (pinfo->type == CHAT_TYPE_TALKING  pinfo->type == CHAT_TYPE_PARTY  pinfo->type == CHAT_TYPE_GUILD || pinfo->type == CHAT_TYPE_SHOUT))
            {
                ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ox konusmasi"));
                return iExtraLen;
            }
        }
    }
#endif

c++ 2:
Genişlet Daralt Kopyala
if (quest::CQuestManager::instance().GetEventFlag("ox_chat_engel") == 1)
    {
        if(!ch->IsGM())
        {
            if(ch->GetMapIndex() == 113 && (pinfo->type == CHAT_TYPE_TALKING  pinfo->type == CHAT_TYPE_PARTY  pinfo->type == CHAT_TYPE_GUILD || pinfo->type == CHAT_TYPE_SHOUT))
            {
                ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ox konusmasi"));
                return iExtraLen;
            }
        }
    }


Bu iki yöntemdede bu hatayı verdi koddada hata olduğunu düşünmüyorum.
Hata:
Genişlet Daralt Kopyala
input_main.cpp:737: error: expected `)' before 'pinfo'
input_main.cpp:742: error: expected `)' before '}' token
input_main.cpp:742: error: expected primary-expression before '}' token
input_main.cpp:742: error: expected `;' before '}' token
 
c++:
Genişlet Daralt Kopyala
#ifdef ENABLE_OXCHATENGEL
    if (quest::CQuestManager::instance().GetEventFlag("ox_chat_engel") == 1)
    {
        if(ch->IsGM() == false)
        {
            if(ch->GetMapIndex() == 113 && (pinfo->type == CHAT_TYPE_TALKING  pinfo->type == CHAT_TYPE_PARTY  pinfo->type == CHAT_TYPE_GUILD || pinfo->type == CHAT_TYPE_SHOUT))
            {
                ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ox konusmasi"));
                return iExtraLen;
            }
        }
    }
#endif

c++ 2:
Genişlet Daralt Kopyala
if (quest::CQuestManager::instance().GetEventFlag("ox_chat_engel") == 1)
    {
        if(!ch->IsGM())
        {
            if(ch->GetMapIndex() == 113 && (pinfo->type == CHAT_TYPE_TALKING  pinfo->type == CHAT_TYPE_PARTY  pinfo->type == CHAT_TYPE_GUILD || pinfo->type == CHAT_TYPE_SHOUT))
            {
                ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ox konusmasi"));
                return iExtraLen;
            }
        }
    }


Bu iki yöntemdede bu hatayı verdi koddada hata olduğunu düşünmüyorum.
Hata:
Genişlet Daralt Kopyala
input_main.cpp:737: error: expected `)' before 'pinfo'
input_main.cpp:742: error: expected `)' before '}' token
input_main.cpp:742: error: expected primary-expression before '}' token
input_main.cpp:742: error: expected `;' before '}' token
burda bahsi geçen kodlama benim kendimce yaptığım kodlama sizinkiyle aynı işlevde sanıyorum
 
C++:
Genişlet Daralt Kopyala
if(ch->GetMapIndex() == 113 && (pinfo->type == CHAT_TYPE_TALKING
Buradan sonraki kısımlara dikkat et, ve-veya operatörleri yok.
 
Uyarı: Bu konu açıldığından bu yana baya zaman geçmiş.
Muhtemelen daha fazla tartışma gerekli değildir ki bu durumda yeni bir konu başlatmayı öneririz. Eğer yine de cevabınızın gerekli olduğunu düşünüyorsanız buna rağmen cevap verebilirsiniz.
Geri
Üst