Quote:
Originally Posted by Nalidor
In the team change natives, "if (team != TEAM_RED || team != TEAM_BLUE)" should be "if (team != TEAM_RED && team != TEAM_BLUE)". The former always causes the functions to throw an invalid team error.
|
This is my very first attempt to make natives. Could you send me your plugin you are trying to code in a PM, the entire thing please. I will check to see how you are coding the natives into it.
The code I have in there is actually correct. It if you do not supply a proper team index(ie. 2, or 3) then it will error out. You cannot switch in a forced mannor to spectator(team 1) or an invalid team (anything other than 2 or 3). So the code that says || (or) is actually correct and the code that you use (&&) will actually cause problems. That would require you to have a team that is both red AND blue, and that is impossible. You want it to be red OR blue.
Also, bots don't have valid client index numbers and are not accounted for in my plugin. You are getting those errors because the plugin can't interpolate the client index, and is in fact, an invalid client. So code like this:
PHP Code:
SetEventInt(event, "player", client);
or anything that has to do with the client index will cause errors.
Change the code back to || (or) and add this to the top of your plugin:
PHP Code:
#define TEAM_RED 2
#define TEAM_BLUE 3
Then when sending the team, use the constant, that should solve most of your problems.
Hope that helps, but if you need more help send me the plugin you are working on in a PM.
Quote:
Originally Posted by slipenbois
Really nice plugin used now on my own server.
Here's the french translation.
++
|
Thanks!
++