Topic: BanAddr
Hello all
I want to use banaddr in player.cpp file how do this
pThis->BanAddr(pThis->Server()->m_NetServer.ClientAddr(ClientID), 60*60, "Test");
You are not logged in. Please login or register.
Teeworlds Forum → Support → BanAddr
Hello all
I want to use banaddr in player.cpp file how do this
pThis->BanAddr(pThis->Server()->m_NetServer.ClientAddr(ClientID), 60*60, "Test");
I doubt that pThis exists on default somewhere in CPlayer... You should show us your whole snippet.
What you want to have is a pointer to the CServerBan object, which is AFAIK not accessible from CPlayer without some other modifications to the source. I would suggest you to use the (a bit hacky) way below if you are a beginner at programming and just want to hack your own mod quickly:
char aAddr[NETADDR_MAXSTRSIZE];
GameServer()->Server()->GetClientAddr(GetCID(), aAddr, NETADDR_MAXSTRSIZE);
char aBan[128];
str_format(aBan, sizeof aBan, "ban %s %d %s", aAddr, 60*60, "Test" );
GameServer()->Console()->ExecuteLine(aBan);
Not tested, but should be working. **note that this is not the proper way, but its even done in fng that way**
Teeworlds Forum → Support → BanAddr
Powered by PunBB, supported by Informer Technologies, Inc.
Currently installed 3 official extensions. Copyright © 2003–2009 PunBB.