Page 1 of 1

bz_killPlayer

Posted: Tue Dec 26, 2006 5:29 pm
by LouMan
I am using the BZF_API bool bz_killPlayer ( int playerID, bool spawnOnBase ) function in a plugin I have been working on and I seem to be having some difficulty with its behavior.

When the function is called, it will remove the player's flag and make the player unresponsive (nr), but not destroy/explode the player and allow a respawn.

I am running bzfs with the plugin locally (not public) and my bzflag application is running on the same pc as the bzfs application; I'm not sure if that has anything to do with it or not. I have tried it with multiple pc's on the same local network and I have tried it with bots - always get "nr" for those killed with the function. I've also run bzfs with the "killall" plugin locally with the same results.

Does this function only work when it is associated with a public server?

Any information/insight on this would be greatly appreciated :)

Posted: Tue Dec 26, 2006 11:18 pm
by L4m3r
The function isn't documented correctly. It also requires a "from" parameter (I think it should be the last one but I'm not positive), telling who should have made the kill. in most situations, this should be BZ_SERVER.

Posted: Wed Dec 27, 2006 1:45 am
by LouMan
Wonderful! Works great now - thanks so much :) :)

btw - it was the last one ;)

Posted: Tue Jan 02, 2007 12:40 am
by Enigma
Yesterday, while trying out the /killall plugin, I had the same problem. I also solved it by passing more parameters.

There is one more parameter after killerID.
BZF_API bool bz_killPlayer ( int playeID, bool spawnOnBase, int killerID = -1, const char* flagID = NULL );

I think this might be the problem:
#define BZ_ALLUSERS -1

and

int killerID = -1 (the function parameter).

It doesn't make sense for everyone to kill a player at once.