Topic: How to create in chat commands?
Topic subject, ok?
Where i need to put commands? What file I need(name and extension)?
You are not logged in. Please login or register.
Teeworlds Forum → Modifications → How to create in chat commands?
Topic subject, ok?
Where i need to put commands? What file I need(name and extension)?
No this is also the wrong topic, try https://www.teeworlds.com/forum/viewforum.php?id=24
oups i wrote it in wrong thing thhx
Do you have any knowledge of programming? If not, it's a long road ahead
i know lua language(also know about chatcommand functions), no more, is teeworlds using lua language?
No
what programming language is needed for commands in teeworlds? i should learn it.
Almost the entire codebase is in C++
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
DELETED
Teeworlds Forum → Modifications → How to create in chat commands?
Powered by PunBB, supported by Informer Technologies, Inc.
Currently installed 3 official extensions. Copyright © 2003–2009 PunBB.