Topic: [QUESTION] Adding a ban from game/server/hooks.cpp
Hi guys,
i want to add an IP-ban from hooks.cpp. My target is to ban all users that change their names to [bot]...
if(msgtype == NETMSGTYPE_CL_CHANGEINFO && strcmp(oldname, server_clientname(client_id)) != 0)
{
char chattext[256];
str_format(chattext, sizeof(chattext), "%s changed name to %s", oldname, server_clientname(client_id));
if(strstr(server_clientname(client_id),"[bot]") != NULL) {
// ban him!
} else {
game.send_chat(-1, GAMECONTEXT::CHAT_ALL, chattext);
}
}
I couldn't find any function to do this. Does only the es_server.c handle bans?