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: 30
Joined: Mon Jul 11, 2016 9:38 pm
Location: U.S.A
Contact:

BZToolKit bztk_changeTeam always changes to Rogue

Post by The Noah » Mon Oct 09, 2017 3:24 am

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

User avatar
allejo
Breaker of Builds
Breaker of Builds
Posts: 648
Joined: Sun Feb 17, 2008 10:01 pm
Location: /dev/null
Contact:

Re: BZToolKit bztk_changeTeam always changes to Rogue

Post by allejo » Mon Oct 09, 2017 4:00 am

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?
Here's my personal website and my open source projects are available on GitHub; I work on a lot of cool things.

Image

User avatar
The Noah
Private First Class
Private First Class
Posts: 30
Joined: Mon Jul 11, 2016 9:38 pm
Location: U.S.A
Contact:

Re: BZToolKit bztk_changeTeam always changes to Rogue

Post by The Noah » Mon Oct 09, 2017 2:06 pm

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

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests