help with killing every player

Questions, comments, and news on the server side plug-ins and it's API
Post Reply
User avatar
the panda next door
Private First Class
Private First Class
Posts: 42
Joined: Sun Mar 16, 2008 3:55 am
Location: Las Vegas

help with killing every player

Post by the panda next door »

what is the code I use to kill ever player on my map?

Also, when I run /killall, the server crashes.
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Post by JeffM »

if you are in the API, use bz_getPlayerIndexList to get the list of palyers. then just loop thru them all and kill everyone who isn't an observer using bz_killPlayer
ImageJeffM
User avatar
the panda next door
Private First Class
Private First Class
Posts: 42
Joined: Sun Mar 16, 2008 3:55 am
Location: Las Vegas

Post by the panda next door »

my plugin blows everyone up on a flag capture.
when a flag is captured, the server crashes after it prints this:

Code: Select all

Player that broken tank over ther [1] (Green Team) might have tried to capture Blue Team flag without reaching their own base. (Player position: 4.580000 -27.020000 0.000000)
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Post by JeffM »

run a debugger and see why it crashes.
ImageJeffM
User avatar
the panda next door
Private First Class
Private First Class
Posts: 42
Joined: Sun Mar 16, 2008 3:55 am
Location: Las Vegas

Post by the panda next door »

Can someone post the code? What I am trying isn't working.
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Post by JeffM »

run a debugger and see why it crashes.
ImageJeffM
User avatar
the panda next door
Private First Class
Private First Class
Posts: 42
Joined: Sun Mar 16, 2008 3:55 am
Location: Las Vegas

Post by the panda next door »

How do I run a debugger?
User avatar
joevano
General
General
Posts: 1863
Joined: Sat Jun 18, 2005 1:08 pm
Location: South Bend, Indiana, USA

Post by joevano »

broken tank over there wrote:How do I run a debugger?
That is a topic way to large for here. Do some searching on the interwebz (try googling). Debugging is an integral part of programming, looks like you got some learning to do. Look for a tutorial. Running a debugger isn't difficult, finding the bugs can be, but without one it would be nearly impossible.
There is nothing worse than aggressive stupidity. -- Johann Wolfgang von Goethe
"How many legs does a dog have if you call his tail a leg? Four. Calling a tail a leg doesn't make it a leg." -- Abraham Lincoln
User avatar
the panda next door
Private First Class
Private First Class
Posts: 42
Joined: Sun Mar 16, 2008 3:55 am
Location: Las Vegas

Post by the panda next door »

Would it be possible to use the debugger in Xcode?
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Post by JeffM »

yes
ImageJeffM
User avatar
the panda next door
Private First Class
Private First Class
Posts: 42
Joined: Sun Mar 16, 2008 3:55 am
Location: Las Vegas

Post by the panda next door »

How would I set the debugger up?
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Post by JeffM »

that is not a subject for these forums. You should read the docs and learn how to use your tools. There is a lot of information on how to use X code on the internet.
ImageJeffM
Enigma
Private First Class
Private First Class
Posts: 212
Joined: Sat Apr 23, 2005 3:13 am

Post by Enigma »

You already have a debugger: gdb and Dtrace. I have no idea how to use Dtrace, as I am not inclined to learn the D programming language just to use it, but I know how to use gdb a little bit. To load bzfs in gdb, just type "gdb bzfs" in the terminal. Once gdb is running, type "run -conf <conf>." Then run bzfs until it crashes. When it crashes, you can type "backtrace" to find what caused the crash. I forgot how to step through the program, and I never learned anything past the basics.

Just search "gdb tutorial" in Google.

Oh, and FYI, if you are going to get involved in programming, you should expect to do A LOT of reading.

Also, since BZFlag isn't the place to learn how to program, you should check out gamedev.net. You don't have to do game programming, and it is an excellent resource/community.

And don't forget to pass --enable-debug to configure!


One more thing, if you arrive at another problem, try to research your problem first, and only ask for help after you have made a significant effort to find a solution. You've probably spent more than a day asking about a debugger, and all you had to do is search "xcode debugger" in Google. You could have also tried to look for answers at developer.apple.com.
Post Reply