1

Topic: How to create in chat commands?

Topic subject, ok?
Where i need to put commands? What file I need(name and extension)?

Started playing teeworlds since 31 December, 2018.

2

Re: How to create in chat commands?

No this is also the wrong topic, try https://www.teeworlds.com/forum/viewforum.php?id=24

I will be banned if I troll again ...

3

Re: How to create in chat commands?

oups i wrote it in wrong thing thhx

Started playing teeworlds since 31 December, 2018.

4

Re: How to create in chat commands?

Do you have any knowledge of programming? If not, it's a long road ahead

Not Luck, Just Magic.

5

Re: How to create in chat commands?

i know lua language(also know about chatcommand functions), no more, is teeworlds using lua language?

Started playing teeworlds since 31 December, 2018.

6

Re: How to create in chat commands?

No

Not Luck, Just Magic.

7 (edited by CrazyKolya 2019-01-20 12:53:41)

Re: How to create in chat commands?

what programming language is needed for commands in teeworlds? i should learn it.

Started playing teeworlds since 31 December, 2018.

8

Re: How to create in chat commands?

Almost the entire codebase is in C++

Not Luck, Just Magic.

9 (edited by Barsik 2019-05-09 10:26:33)

Re: How to create in chat commands?

Sorry, my post is non-english post

Topic subject, ok?
Where i need to put commands? What file I need(name and extension)?

Коля, если ты русский, то бери на здоровье.
заходишь в src\game\server\gamecontext.cpp
находишь эти строчки(Ctrl+F)

pPlayer->m_LastChat = Server()->Tick();

SendChat(ClientID, Team, pMsg->m_pMessage);

если тебе нужна команда по типу /help, то

            if (!str_comp_nocase(pMsg->m_pMessage + 1, "help"))
            {
                SendChatTarget(pPlayer->GetCID(), "whats up guys");
                SendChatTarget(pPlayer->GetCID(), "im fine");
                SendChatTarget(pPlayer->GetCID(), "thx im too");
            }
            else
                SendChat(ClientID, Team, pMsg->m_pMessage);

если команда по типу /myfancyint 8, то

            if (str_comp_nocase_num(pMsg->m_pMessage + 1, "myfancyint ", 11 (кол-во символов в "myfancyint ")) == 0)
            {
                char pValue[32];
                str_copy(pValue, pMsg->m_pMessage + 11, 32);
                m_MyFancyInt = str_toint(pValue);
                return;
            }
            else
                SendChat(ClientID, Team, pMsg->m_pMessage);

если что обращайся в дискорд @gerdoe#8736

russian kiddish

my english speech is good now

10

Re: How to create in chat commands?

You could see my commands tutorial. It's simple and easy to do. smile
https://www.teeworlds.com/forum/viewtopic.php?id=16762

Old Teeworlds ex-gamer | Teeworlds ex-tutorial maker