Resiliant
04-25-2003, 06:30 PM
CMB,
I tried doing this, and got it ALL screwed up because I'm not clear on how you populate the listbox at the end. What I'm trying to do is to add a column to the table for 'Dist' which is simply the spawns x,y,z distance from to the player.
All you have to do is compute the Spawn Distance (sd) as:
sd = Math.sqrt(
(si.X - mapPane1.map.playerinfo.X* (si.X - mapPane1.map.playerinfo.X) +
(si.Y - mapPane1.map.playerinfo.Y) * (si.Y - mapPane1.map.playerinfo.Y) +
(si.Z - mapPane1.map.playerinfo.Z) * (si.Z - mapPane1.map.playerinfo.Z)) ;
and then format it as:
item1.SubItems.Add(sd.ToString("#.0");
I did this, but it simply didnt seem to put it in the table.... vewwy strange..
I guess this ends up as a request ;)
R
I tried doing this, and got it ALL screwed up because I'm not clear on how you populate the listbox at the end. What I'm trying to do is to add a column to the table for 'Dist' which is simply the spawns x,y,z distance from to the player.
All you have to do is compute the Spawn Distance (sd) as:
sd = Math.sqrt(
(si.X - mapPane1.map.playerinfo.X* (si.X - mapPane1.map.playerinfo.X) +
(si.Y - mapPane1.map.playerinfo.Y) * (si.Y - mapPane1.map.playerinfo.Y) +
(si.Z - mapPane1.map.playerinfo.Z) * (si.Z - mapPane1.map.playerinfo.Z)) ;
and then format it as:
item1.SubItems.Add(sd.ToString("#.0");
I did this, but it simply didnt seem to put it in the table.... vewwy strange..
I guess this ends up as a request ;)
R