BZToolKit bztk_changeTeam always changes to Rogue

Questions, comments, and news on the server side plug-ins and it's API
Post Reply
User avatar
The Noah
Private First Class
Private First Class
Posts: 82
Joined: Mon Jul 11, 2016 9:38 pm
Location: United States
Contact:

BZToolKit bztk_changeTeam always changes to Rogue

Post by The Noah »

I'm trying to change a player team based on a string, but no matter what the string is it changes me to Rogue.

Code: Select all

bztk_changeTeam(int playerID, bz_eTeamType team)
//I'm using bztk_eTeamType(string) to convert the string to bz_eTeamType
Any Ideas?
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.

GitHub · Website · Get in touch · Stalk Me
User avatar
allejo
Breaker of Builds
Breaker of Builds
Posts: 809
Joined: Sun Feb 17, 2008 10:01 pm
Location: /dev/null
Contact:

Re: BZToolKit bztk_changeTeam always changes to Rogue

Post by allejo »

Just as an FYI, posting questions relating to writing plug-ins should be belong in this forum. I've moved your previous post and this post away from the "Plug-in Releases" section.

As to answer your question, why not just use the 'eRogueTeam' enum instead of converting from a string? Or are you receiving that value from user input?
User avatar
The Noah
Private First Class
Private First Class
Posts: 82
Joined: Mon Jul 11, 2016 9:38 pm
Location: United States
Contact:

Re: BZToolKit bztk_changeTeam always changes to Rogue

Post by The Noah »

First, I guess I looked in the wrong spot for asking my question, thank you.

And I was able to fix my problem. Here is what I had (more or less)

Code: Select all

bz_eTeamType newTeam;
bz_eTeamType newTeam = bztk_eTeamType("red");
But know I fixed it and it looks like this:

Code: Select all

bz_eTeamType newTeam;
newTeam = bztk_eTeamType("red");
I guess adding 'bz_eTeamType' in front of the var when setting it makes a difference.

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.

GitHub · Website · Get in touch · Stalk Me
Post Reply