Skip to content

Add more API functions #379

Description

@TheGiraffe3

I think it could be nice to have some of the BZFS API functions from the Grue repository.
For example, changing player teams could be useful for the base game's ctfOverseer plugin, and forcing player spawns would be helpful for teleport plugins or always-spawned servers.
A list of Grue's custom functions:

BZF_API bool bz_endServerShot(uint32_t shotID, bool explode = true);
BZF_API uint32_t bz_fireServerShotAsPlayer(const char* shotType, float origin[3], float vector[3],
                                   const char* flagAbbr, int playerID,
                                   float lifetime = -1,
                                   int targetPlayerId = -1);
BZF_API float bz_randFloatBetween(float a, float b);
BZF_API void bz_forcePlayerSpawn(int playerID);
BZF_API bool bz_isTeamFlag(const char* flagAbbr);
BZF_API void bz_sendToTeamsExcept(bz_eTeamType _team, const char* msg, int from = BZ_SERVER);
BZF_API bz_eTeamType bz_getTeamFromFlag(const char* flagAbbr);
BZF_API const char* bz_eTeamTypeLiteral(bz_eTeamType _team);
BZF_API bool bz_changeTeam(int playerID, bz_eTeamType _team);
BZF_API const char* bz_getFlagFromTeam(bz_eTeamType _team);
BZF_API bz_ApiString bz_getPlayerFlagAbbr(int playerID);
BZF_API bool bz_isPlayer(int playerID);
BZF_API bool bz_isValidSpawnPoint(float* pos);
BZF_API float* bz_getServerShotPos(uint32_t shotID);
BZF_API bz_eTeamType bz_getUnbalancedTeam(bz_eTeamType, bz_eTeamType);
BZF_API void bz_setServerVariableForPlayer(int playerID, const std::string& key, const std::string& value);
BZF_API bool bz_isNaturalBadFlag(const char* flagAbbr);
BZF_API bz_eTeamType bz_stringToTeamType(std::string teamColor);

BZF_API bool bz_delayedFlagReset(int flagID);
extern std::queue<std::tuple<double, int>> delayedFlagResetQueue; // time, flagID

Some of these might not be as useful (such as the bz_isTeamFlag function) but I'd like to see some of them in official releases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions