I'm making a plug-in, and when an event is triggered i want to change the player's team. But when i try to compile it (i'm compiling correctly) it gives me the fallowing error:
error: ‘bz_changeTeam’ was not declared in this scope
i don't know how to fix this. I've search Google and this forum, but found nothing.
Thanks,
The Noah
I've been working on a real-time stats site called BZList, please check it out! It is still in active development, so some features are missing and watch out for bugs.
bz_changeTeam
void bz_changeTeam (int player, bz_eTeamType team)
Changes the team of a player. (v3.0)
Parameters:
player - The player who is affected by the team change.
team - The team to set the player to.
There is no way to officially change teams, but there is a way to change teams through a third party API written by Allejo called bzToolkit and it supports changing teams without rejoins.
From bzToolkit readme: A third-party BZFlag plug-in API that consists of functions that do not exist in the official API. There are a lot of functions access BZFS headers directly, a practice that is discouraged, and there are some convenience functions as well.
-Zehra
Those who are critical of me, I'll likely be the same of them. ~Zehra The decisions we make are the ones we look forward too and the ones we regret. ~Zehra There's a difference between knowing my name and knowing me, one shows respect to my name and the other is to who I am. ~Zehra
See where I've last been active atStrayers. Visit BZList.net for a modern HTML5 server stats site.
That "third-party API" isn't an API, it's internal bzfs functions and structures that can and will change without notice, breaking plugins that rely on it. BZFlag 2.4.x does not have a mechanism to change a player's team during the game, only cheap hacks.
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)
Well, personally I think y'all should leave it. It makes things better, and adds more functions. Or you could just integrate it into the BZF API.
I don't mean to sound rude, but please leave it or add it into to BZF API, it will make me happy and I'm sure other people happy too.
Thanks,
The Noah
I've been working on a real-time stats site called BZList, please check it out! It is still in active development, so some features are missing and watch out for bugs.
They need to be added to the API, that is the only viable solution.
The reason to remove the lib is that it's calling internal BZFS functions. Because they are internal, they may be changed as bzflag is developed, and that would break this fake API lib. It is incredibly fragile and not a good way to present a public API. Also it does not work on windows.
A public API is the right way to present a public API.
Yes, integrating it is PERFECT! So if you can, in the next release add it in. And to make existing plug-ins that use the 'API', at first have the functions called the same thing. e.g. 'bz_changeTeam' would still be 'bztk_changeTeam'.
The Noah
I've been working on a real-time stats site called BZList, please check it out! It is still in active development, so some features are missing and watch out for bugs.
If they get integrated they will be made consistant with the existing API style. Comparability with existing plug-ins that use the library will be broken. This is required by the very fact that they are NOT calling a real API, it is unavoidable. Plugins that use it now will need to at the very least be rebuilt, at worst require code modifications.
Binary compatibility with a fake API is not our concern, and is one of the main problems with it's very existence. That's what you get for trying to fake out the API