Official 5165 FAQ/Question thread

02/20/2010 17:45 sneaky06#1036
This ScreenShot For my Problem if it can help you tu fix it [Only registered and activated users can see links. Click Here To Register...]
02/21/2010 11:31 StarEvaAfta!~#1037
Heyy guys, i havent get the answer for the offical topic for this question so this is active and i think that i will find answer, in Fixed FB/SS system that arco's released in every coords i got error, can someone help meh
02/21/2010 11:31 Arcо#1038
Quote:
Originally Posted by StarEvaAfta!~ View Post
Heyy guys, i havent get the answer for the offical topic for this question so this is active and i think that i will find answer, in Fixed FB/SS system that arco's released in every coords i got error, can someone help meh
What errors are you getting?
02/21/2010 11:34 StarEvaAfta!~#1039
Code:
Error	2	The type or namespace name 'coords' could not be found (are you missing a using directive or an assembly reference?)	C:\rikardo updated\Features\Skills.cs	199	26	NewestCOServer
02/21/2010 11:34 Arcо#1040
Quote:
Originally Posted by StarEvaAfta!~ View Post
Code:
Error	2	The type or namespace name 'coords' could not be found (are you missing a using directive or an assembly reference?)	C:\rikardo updated\Features\Skills.cs	199	26	NewestCOServer
Post a screenshot please?
02/21/2010 11:56 sneaky06#1041
Can anywone Help Me Plzzzzzzzzzzzzzzzzzzz
02/21/2010 12:01 StarEvaAfta!~#1042
here is it


[Only registered and activated users can see links. Click Here To Register...]
02/21/2010 12:03 Arcо#1043
Quote:
Originally Posted by StarEvaAfta!~ View Post
here is it


[Only registered and activated users can see links. Click Here To Register...]
Using the [code][/co*e] wraps, please paste your mymath.cs here.
02/21/2010 12:07 sneaky06#1044
Hey I Thinks i Need An Program to Run It ?????? What Did I need ( programs ) tell me alllllllll
Come on Arco Use You're intelligent Mind !!!!!!!!
02/21/2010 12:28 StarEvaAfta!~#1045
thats it

Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NewestCOServer
{
    public static class MyMath
    {
        public struct coords
        {
            public int X;
            public int Y;

            public coords(int x, int y)
            {
                this.X = x;
                this.Y = y;
            }
        }
        static Random Rnd = new Random();
        public static bool Contains(this coords[] Coords, coords Check)
        {
            foreach (coords Coord in Coords)
                if (Coord.X == Check.X && Check.Y == Coord.Y)
                    return true;
            return false;
        }
        public static List<coords> LineCoords(ushort userx, ushort usery, ushort shotx, ushort shoty, byte length)
        {
            double dir = Math.Atan2(shoty - usery, shotx - userx);
            double f_x = (Math.Cos(dir) * length) + userx;
            double f_y = (Math.Sin(dir) * length) + usery;

            return bresenham(userx, usery, (int)f_x, (int)f_y);
        }
        public static void Add(this List<coords> Coords, int x, int y)
        {
            coords add = new coords((ushort)x, (ushort)y);
            if (!Coords.Contains(add))
                Coords.Add(add);
        }
        public static List<coords> bresenham(int x0, int y0, int x1, int y1)
        {
            List<coords> ThisLine = new List<coords>();

            int dy = y1 - y0;
            int dx = x1 - x0;
            int stepx, stepy;

            if (dy < 0) { dy = -dy; stepy = -1; } else { stepy = 1; }
            if (dx < 0) { dx = -dx; stepx = -1; } else { stepx = 1; }
            dy <<= 1;
            dx <<= 1;

            ThisLine.Add(x0, y0);
            if (dx > dy)
            {
                int fraction = dy - (dx >> 1);
                while (x0 != x1)
                {
                    if (fraction >= 0)
                    {
                        y0 += stepy;
                        fraction -= dx;
                    }
                    x0 += stepx;
                    fraction += dy;
                    ThisLine.Add(x0, y0);
                }
            }
            else
            {
                int fraction = dx - (dy >> 1);
                while (y0 != y1)
                {
                    if (fraction >= 0)
                    {
                        x0 += stepx;
                        fraction -= dy;
                    }
                    y0 += stepy;
                    fraction += dx;
                    ThisLine.Add(x0, y0);
                }
            }
            return ThisLine;
        }
        public static double LevelDifference(byte Lev1, byte Lev2)
        {
            if (Lev1 > Lev2)
            {
                double Rt = (Lev1 - Lev2 + 7) / 5;
                return Rt = ((Rt - 1) * 0.8) + 1;
            }
            return 1;
        }
        public static bool ChanceSuccess(double Chance)
        {            
            int e = Rnd.Next(10000000);
            double a = ((double)e / (double)10000000) * 100;
            return Chance >= a;
        }
        public static double PointDirecton(double x1, double y1, double x2, double y2)
        {
            double direction = 0;

            double AddX = x2 - x1;
            double AddY = y2 - y1;
            double r = (double)Math.Atan2(AddY, AddX);

            if (r < 0) r += (double)Math.PI * 2;

            direction = 360 - (r * 180 / (double)Math.PI);
            return direction;
        }
        public static double PointDirectonRad(double x1, double y1, double x2, double y2)
        {
            double AddX = x2 - x1;
            double AddY = y2 - y1;
            double r = (double)Math.Atan2(AddY, AddX);

            return r;
        }
        public static double PointDirecton2(double x1, double y1, double x2, double y2)
        {
            double direction = 0;

            double AddX = x2 - x1;
            double AddY = y2 - y1;
            double r = (double)Math.Atan2(AddY, AddX);

            direction = (r * 180 / (double)Math.PI);
            return direction;
        }
        public static double RadianToDegree(double r)
        {
            if (r < 0) r += (double)Math.PI * 2;

            double direction = 360 - (r * 180 / (double)Math.PI);
            return direction;
        }
        public static double DegreeToRadian(double degr)
        {
            return degr*Math.PI/180;
        }        
        public static int PointDistance(double x1, double y1, double x2, double y2)
        {
            return (int)Math.Sqrt(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)));
        }
        public static bool InBox(double x1, double y1, double x2, double y2, byte Range)
        {
            return (Math.Max(Math.Abs(x1 - x2), Math.Abs(y1 - y2)) <= Range);
        }
    }
}
02/21/2010 17:29 jayhawka13#1046
Anthony since i cant run on vista or whatever. Im doing hamachi. Ye i followed. I changed the IP to my hamachi one in OldCODB.. and in my client.. So i make a new acc and try to login but i get the problem is that when i try to login it loads halway n gets stuck..
02/21/2010 17:33 Arcо#1047
Quote:
Originally Posted by StarEvaAfta!~ View Post
thats it

Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NewestCOServer
{
    public static class MyMath
    {
        public struct coords
        {
            public int X;
            public int Y;

            public coords(int x, int y)
            {
                this.X = x;
                this.Y = y;
            }
        }
        static Random Rnd = new Random();
        public static bool Contains(this coords[] Coords, coords Check)
        {
            foreach (coords Coord in Coords)
                if (Coord.X == Check.X && Check.Y == Coord.Y)
                    return true;
            return false;
        }
        public static List<coords> LineCoords(ushort userx, ushort usery, ushort shotx, ushort shoty, byte length)
        {
            double dir = Math.Atan2(shoty - usery, shotx - userx);
            double f_x = (Math.Cos(dir) * length) + userx;
            double f_y = (Math.Sin(dir) * length) + usery;

            return bresenham(userx, usery, (int)f_x, (int)f_y);
        }
        public static void Add(this List<coords> Coords, int x, int y)
        {
            coords add = new coords((ushort)x, (ushort)y);
            if (!Coords.Contains(add))
                Coords.Add(add);
        }
        public static List<coords> bresenham(int x0, int y0, int x1, int y1)
        {
            List<coords> ThisLine = new List<coords>();

            int dy = y1 - y0;
            int dx = x1 - x0;
            int stepx, stepy;

            if (dy < 0) { dy = -dy; stepy = -1; } else { stepy = 1; }
            if (dx < 0) { dx = -dx; stepx = -1; } else { stepx = 1; }
            dy <<= 1;
            dx <<= 1;

            ThisLine.Add(x0, y0);
            if (dx > dy)
            {
                int fraction = dy - (dx >> 1);
                while (x0 != x1)
                {
                    if (fraction >= 0)
                    {
                        y0 += stepy;
                        fraction -= dx;
                    }
                    x0 += stepx;
                    fraction += dy;
                    ThisLine.Add(x0, y0);
                }
            }
            else
            {
                int fraction = dx - (dy >> 1);
                while (y0 != y1)
                {
                    if (fraction >= 0)
                    {
                        x0 += stepx;
                        fraction -= dy;
                    }
                    y0 += stepy;
                    fraction += dx;
                    ThisLine.Add(x0, y0);
                }
            }
            return ThisLine;
        }
        public static double LevelDifference(byte Lev1, byte Lev2)
        {
            if (Lev1 > Lev2)
            {
                double Rt = (Lev1 - Lev2 + 7) / 5;
                return Rt = ((Rt - 1) * 0.8) + 1;
            }
            return 1;
        }
        public static bool ChanceSuccess(double Chance)
        {            
            int e = Rnd.Next(10000000);
            double a = ((double)e / (double)10000000) * 100;
            return Chance >= a;
        }
        public static double PointDirecton(double x1, double y1, double x2, double y2)
        {
            double direction = 0;

            double AddX = x2 - x1;
            double AddY = y2 - y1;
            double r = (double)Math.Atan2(AddY, AddX);

            if (r < 0) r += (double)Math.PI * 2;

            direction = 360 - (r * 180 / (double)Math.PI);
            return direction;
        }
        public static double PointDirectonRad(double x1, double y1, double x2, double y2)
        {
            double AddX = x2 - x1;
            double AddY = y2 - y1;
            double r = (double)Math.Atan2(AddY, AddX);

            return r;
        }
        public static double PointDirecton2(double x1, double y1, double x2, double y2)
        {
            double direction = 0;

            double AddX = x2 - x1;
            double AddY = y2 - y1;
            double r = (double)Math.Atan2(AddY, AddX);

            direction = (r * 180 / (double)Math.PI);
            return direction;
        }
        public static double RadianToDegree(double r)
        {
            if (r < 0) r += (double)Math.PI * 2;

            double direction = 360 - (r * 180 / (double)Math.PI);
            return direction;
        }
        public static double DegreeToRadian(double degr)
        {
            return degr*Math.PI/180;
        }        
        public static int PointDistance(double x1, double y1, double x2, double y2)
        {
            return (int)Math.Sqrt(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)));
        }
        public static bool InBox(double x1, double y1, double x2, double y2, byte Range)
        {
            return (Math.Max(Math.Abs(x1 - x2), Math.Abs(y1 - y2)) <= Range);
        }
    }
}
Try replacing with this
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NewestCOServer
{
    public struct coords
    {
        public int X;
        public int Y;

        public coords(int x, int y)
        {
            this.X = x;
            this.Y = y;
        }
    }
    public static class MyMath
    {
        public static bool Contains(this coords[] Coords, coords Check)
        {
            foreach (coords Coord in Coords)
                if (Coord.X == Check.X && Check.Y == Coord.Y)
                    return true;
            return false;
        }
        public static List<coords> LineCoords(ushort userx, ushort usery, ushort shotx, ushort shoty, byte length)
        {
            double dir = Math.Atan2(shoty - usery, shotx - userx);
            double f_x = (Math.Cos(dir) * length) + userx;
            double f_y = (Math.Sin(dir) * length) + usery;

            return bresenham(userx, usery, (int)f_x, (int)f_y);
        }
        public static void Add(this List<coords> Coords, int x, int y)
        {
            coords add = new coords((ushort)x, (ushort)y);
            if (!Coords.Contains(add))
                Coords.Add(add);
        }
        public static List<coords> bresenham(int x0, int y0, int x1, int y1)
        {
            List<coords> ThisLine = new List<coords>();

            int dy = y1 - y0;
            int dx = x1 - x0;
            int stepx, stepy;

            if (dy < 0) { dy = -dy; stepy = -1; } else { stepy = 1; }
            if (dx < 0) { dx = -dx; stepx = -1; } else { stepx = 1; }
            dy <<= 1;
            dx <<= 1;

            ThisLine.Add(x0, y0);
            if (dx > dy)
            {
                int fraction = dy - (dx >> 1);
                while (x0 != x1)
                {
                    if (fraction >= 0)
                    {
                        y0 += stepy;
                        fraction -= dx;
                    }
                    x0 += stepx;
                    fraction += dy;
                    ThisLine.Add(x0, y0);
                }
            }
            else
            {
                int fraction = dx - (dy >> 1);
                while (y0 != y1)
                {
                    if (fraction >= 0)
                    {
                        x0 += stepx;
                        fraction -= dy;
                    }
                    y0 += stepy;
                    fraction += dx;
                    ThisLine.Add(x0, y0);
                }
            }
            return ThisLine;
        }
        static Random Rnd = new Random();
        public static double LevelDifference(byte Lev1, byte Lev2)
        {
            if (Lev1 > Lev2)
            {
                double Rt = (Lev1 - Lev2 + 7) / 5;
                return Rt = ((Rt - 1) * 0.8) + 1;
            }
            return 1;
        }
        public static bool ChanceSuccess(double Chance)
        {
            int e = Rnd.Next(10000000);
            double a = ((double)e / (double)10000000) * 100;
            return Chance >= a;
        }
        public static double PointDirecton(double x1, double y1, double x2, double y2)
        {
            double direction = 0;

            double AddX = x2 - x1;
            double AddY = y2 - y1;
            double r = (double)Math.Atan2(AddY, AddX);

            if (r < 0) r += (double)Math.PI * 2;

            direction = 360 - (r * 180 / (double)Math.PI);
            return direction;
        }
        public static double PointDirectonRad(double x1, double y1, double x2, double y2)
        {
            double AddX = x2 - x1;
            double AddY = y2 - y1;
            double r = (double)Math.Atan2(AddY, AddX);

            return r;
        }
        public static double PointDirecton2(double x1, double y1, double x2, double y2)
        {
            double direction = 0;

            double AddX = x2 - x1;
            double AddY = y2 - y1;
            double r = (double)Math.Atan2(AddY, AddX);

            direction = (r * 180 / (double)Math.PI);
            return direction;
        }
        public static double RadianToDegree(double r)
        {
            if (r < 0) r += (double)Math.PI * 2;

            double direction = 360 - (r * 180 / (double)Math.PI);
            return direction;
        }
        public static double DegreeToRadian(double degr)
        {
            return degr * Math.PI / 180;
        }
        public static int PointDistance(double x1, double y1, double x2, double y2)
        {
            return (int)Math.Sqrt(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)));
        }
        public static bool InBox(double x1, double y1, double x2, double y2, byte Range)
        {
            return (Math.Max(Math.Abs(x1 - x2), Math.Abs(y1 - y2)) <= Range);
        }
    }
}
02/21/2010 17:43 jayhawka13#1048
read up ^ n help meh
02/21/2010 17:49 Arcо#1049
Quote:
Originally Posted by jayhawka13 View Post
read up ^ n help meh
What errors do you get?
Does it happen to be this?
[Only registered and activated users can see links. Click Here To Register...]
02/21/2010 21:59 sneaky06#1050
Hey guys do i have to edit server.dat??????????