keeping track of a user's name
Posted: July 17th, 2009, 8:21 pm
Okay, well My friend and I are making a new gametype called Bounty Hunter, which is where when you spawn everyone is assigned a target which they have to kill. When they kill the target they get one point, and if they kill the person hunting them they get another point. If they kill everyone else they get -1 points.
I need to be able to track the users kills and name. Originally Nightmare made the code and had some errors in it, well we managed to get those errors to work. But now we just need to be able to track the players name correctly, so the person knows who their target is.
So what this code does is make a hud element that says 'BH_HD2_TARGET' instead of the value contained in self.BHTarget.name. I've tested the value in self.BHTarget.name with iprintln and it contains the correct value (it's not null).
I need to be able to track the users kills and name. Originally Nightmare made the code and had some errors in it, well we managed to get those errors to work. But now we just need to be able to track the players name correctly, so the person knows who their target is.
Code: Select all
precacheString(&"BH_HUD2_TARGET");
Code: Select all
self.bh_hud2_target = newClientHudElem(self);
self.bh_hud2_target.archived = false;
self.bh_hud2_target.x = 519.5;
self.bh_hud2_target.y = 402;
self.bh_hud2_target.alignX = "left";
self.bh_hud2_target.alignY = "top";
self.bh_hud2_target.sort = 1;
self.bh_hud2_target.fontScale = .8;
self.bh_hud2_target.label = &"BH_HUD2_TARGET";
self.bh_hud2_target setValue(self.BHTarget.name);
iprintln("bhtarget:" + self.BHTarget.name);