Skocz do zawartości

Dołącz do społeczności!

👋 Witaj na MPCForum!

Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

  • ✅ Pełny dostęp do działów i ukrytych treści
  • ✅ Możliwość pisania i odpowiadania w tematach
  • ✅ System prywatnych wiadomości
  • ✅ Zbieranie reputacji i rozwijanie swojego profilu
  • ✅ Członkostwo w jednej z największych społeczności graczy

👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

Zarejestruj się teraz

Pobieranie Levelu na czacie

Rekomendowane odpowiedzi

Opublikowano

Witajcie,

Chciałbym zrobić sobie takie coś na czacie ogólnym:

const char* kingdoms[3] = {"|cFFff0000|H|h[Shinsoo]|cFFA7FFD4|H|h", "|cFFFFFF00|H|h[Chunjo]|cFFA7FFD4|H|h", "|cFF0080FF|H|h[Jinno]|cFFA7FFD4|H|h"};
char chatbuf_global[CHAT_MAX_LEN + 1];
int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s |cFF40E0B0|H|h[Lv. %d]|cFFA7FFD4|H|h |Hmsg:%s|h%s|h|r : %s", kingdoms[ch->GetEmpire()-1], ch->GetLevel(), ch->GetName(), ch->GetName(), buf);

Udostępnił to Endymion :) Wie ktoś może jak to dodać? Sama zamiana nic nie daje i jest błąd przy kompilacji.

Z góry wielkie dzięki :)

Opublikowano

ale co ty chcesz dodać? Przecież masz gotowy kod wbijasz do input_main.cpp i zamieniasz.

#EMERYTURA

Opublikowano

No właśnie robiłem z tego + dodałem to co endymion dał w temat i nie działa :/

 

Co dokładnie nie działa? game się nie kompiluje czy czat w grze nie działa.

Rozwiń się trochę gościu przecież zgadywać nie będziemy XDDD

#EMERYTURA

Opublikowano
  • Autor

Co dokładnie nie działa? game się nie kompiluje czy czat w grze nie działa.

Rozwiń się trochę gościu przecież zgadywać nie będziemy XDDD

Nie kompiluje się game ;)

Opublikowano
  • Autor

Daj errory z kompilacji .

 
input_main.cpp:244: error: expected unqualified-id before 'if'
input_main.cpp:247: error: expected unqualified-id before 'if'
input_main.cpp:255: error: 'ch' was not declared in this scope
input_main.cpp:257: error: expected unqualified-id before 'if'
input_main.cpp:261: error: expected unqualified-id before 'if'
input_main.cpp:265: error: expected unqualified-id before 'else'
input_main.cpp:48: warning: 'int __deposit_limit()' defined but not used
gmake: *** [OBJDIR/input_main.o] Error 1
Opublikowano
  • Autor



gmake: Warning: File `input_main.cpp' has modification time 7176 s in the future
compile input_main.cpp
In file included from input_main.cpp:16:
shop_manager.h:40:7: warning: no newline at end of file
input_main.cpp:565: error: 'void operator()(DESC*)' must be a nonstatic member function
input_main.cpp:577: error: expected declaration before '}' token
input_main.cpp:48: warning: 'int __deposit_limit()' defined but not used
gmake: *** [OBJDIR/input_main.o] Error 1

Opublikowano
  • Autor

@NoName#2

shop_manager.h:40:7: warning: no newline at end of file
input_main.cpp:3372:22: warning: no newline at end of file
input_main.cpp: In function 'int ProcessTextTag(CHARACTER*, const char*, size_t)':
input_main.cpp:241: warning: unused variable 'hyperlinks'
input_main.cpp:242: warning: unused variable 'colored'
input_main.cpp: At global scope:
input_main.cpp:245: error: expected constructor, destructor, or type conversion before '(' token
input_main.cpp:247: error: expected unqualified-id before 'if'
input_main.cpp:250: error: expected unqualified-id before 'if'
input_main.cpp:258: error: 'ch' was not declared in this scope
input_main.cpp:260: error: expected unqualified-id before 'if'
input_main.cpp:264: error: expected unqualified-id before 'if'
input_main.cpp:268: error: expected unqualified-id before 'else'
input_main.cpp:48: warning: 'int __deposit_limit()' defined but not used
gmake: *** [OBJDIR/input_main.o] Error 1
Opublikowano

Usuń:

} z linijki 243

}; z  linijki 564

 

 

PS.

przy wytabulowanym kodzie na prawde nie powinno byc az takich problemów z niezamkniętymi/ podwójnie zamkniętymi warunkami i funkcjami... a jednak

Edytowane przez Mozzie

Opublikowano

 

@NoName#2

shop_manager.h:40:7: warning: no newline at end of file
input_main.cpp:3372:22: warning: no newline at end of file
input_main.cpp: In function 'int ProcessTextTag(CHARACTER*, const char*, size_t)':
input_main.cpp:241: warning: unused variable 'hyperlinks'
input_main.cpp:242: warning: unused variable 'colored'
input_main.cpp: At global scope:
input_main.cpp:245: error: expected constructor, destructor, or type conversion before '(' token
input_main.cpp:247: error: expected unqualified-id before 'if'
input_main.cpp:250: error: expected unqualified-id before 'if'
input_main.cpp:258: error: 'ch' was not declared in this scope
input_main.cpp:260: error: expected unqualified-id before 'if'
input_main.cpp:264: error: expected unqualified-id before 'if'
input_main.cpp:268: error: expected unqualified-id before 'else'
input_main.cpp:48: warning: 'int __deposit_limit()' defined but not used
gmake: *** [OBJDIR/input_main.o] Error 1

 

Zrobione http://wklej.to/JLCi4

Opublikowano
  • Autor
compile input_main.cpp
In file included from input_main.cpp:16:
shop_manager.h:40:7: warning: no newline at end of file
input_main.cpp:3373:2: warning: no newline at end of file
input_main.cpp: In member function 'int CInputMain::Chat(CHARACTER*, const char*, size_t)':
input_main.cpp:687: error: 'chatbuf' was not declared in this scope
input_main.cpp:695: error: 'len' was not declared in this scope
input_main.cpp:695: error: 'chatbuf' was not declared in this scope
input_main.cpp:698: error: 'chatbuf' was not declared in this scope
input_main.cpp:698: error: 'len' was not declared in this scope
input_main.cpp:683: warning: unused variable 'len_global'
gmake: *** [OBJDIR/input_main.o] Error 1

@NoName#2

Edytowane przez Kennsy

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

Ostatnio przeglądający 0

  • Brak zarejestrowanych użytkowników przeglądających tę stronę.

Konto

Nawigacja

Skonfiguruj powiadomienia push w przeglądarce

Chrome (Android)
  1. Stuknij ikonę kłódki obok paska adresu.
  2. Stuknij Uprawnienia → Powiadomienia.
  3. Dostosuj swoje ustawienie.
Chrome (Komputer)
  1. Kliknij ikonę kłódki na pasku adresu.
  2. Wybierz Ustawienia witryny.
  3. Znajdź Powiadomienia i dostosuj swoje ustawienie.