bz_killPlayer

Questions, comments, and news on the server side plug-ins and it's API
Post Reply
User avatar
LouMan
Chief Sgt. of Cartography
Chief Sgt. of Cartography
Posts: 338
Joined: Mon Jan 31, 2005 3:05 am
Location: Michigan, USA

bz_killPlayer

Post 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 :)
User avatar
L4m3r
Hater of Everything
Hater of Everything
Posts: 724
Joined: Tue Feb 08, 2005 5:15 am
Location: Los Angeles

Post 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.
Optimism is just a milder alternative to denial.
User avatar
LouMan
Chief Sgt. of Cartography
Chief Sgt. of Cartography
Posts: 338
Joined: Mon Jan 31, 2005 3:05 am
Location: Michigan, USA

Post by LouMan »

Wonderful! Works great now - thanks so much :) :)

btw - it was the last one ;)
Enigma
Private First Class
Private First Class
Posts: 212
Joined: Sat Apr 23, 2005 3:13 am

Post 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.
Post Reply