قديم 2019-12-02, 01:30 AM
المشاركة 2
Hassan Emprator
.:: عضو خبير ::.
  • غير متواجد
افتراضي رد: ايرور عند اضافة الاوتو انفيت بتاع الفلاج
بدل يحب الكلاس دا بي الي عندك

وغير اسم لابروكت وغيره لي اسم الفلاج بتاعك


كود:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MrHassan.Network.GamePackets;
using MrHassan.Client;
using System.Collections.Concurrent;
using MrHassan.Game.ConquerStructures.Society;
using MrHassan.Network;
using MrHassan.Database;

namespace 
MrHassan.Game
{
    public class 
CaptureTheFlag
    
{
        public class 
CTF_Rank Writer
        
{
            private 
byte[] Packet;
            public 
CTF_Rank(GameState client)
            {
                
this.Packet = new byte[354];
                
Writer.WriteUInt16(3460this.Packet);
                
Writer.WriteUInt16(10632this.Packet);
                
this.Packet[4] = 9;
                
this.Packet[6] = 1;
                
this.Packet[14] = 8;
                
Writer.WriteUInt32(client.Guild.CTFPoints18this.Packet);
            }
            public 
void Send(GameState client)
            {
                
client.Send(this.ToArray());
            }
            public 
byte[] ToArray()
            {
                
ushort num 30;
                
Guild[] array = (
                    
from p in Kernel.Guilds.Values
                    where p
.CTFPoints != 0u
                    orderby p
.CTFPoints descending
                    select p
).ToArray<Guild>();
                if (array != 
null)
                {
                    
byte b 0;
                    while ((int)
< array.Length && != 9)
                    {
                        
Writer.WriteString(array[(int)b].Name, (int)numthis.Packet);
                        
num += 16;
                        
Writer.WriteUInt32(array[(int)b].CTFPoints, (int)numthis.Packet);
                        
num += 4;
                        
Writer.WriteUInt32(array[(int)b].MemberCount, (int)numthis.Packet);
                        
num += 4;
                        
Writer.WriteUInt64((ulong)array[(int)b].CTFdonationSilverold, (int)numthis.Packet);
                        
num += 8;
                        
Writer.WriteUInt32(array[(int)b].CTFdonationCPsold, (int)numthis.Packet);
                        
num += 4;
                        
+= 1;
                    }
                }
                return 
this.Packet;
            }
        }
        public class 
Base
        
{
            public 
SobNpcSpawn Flag;
            public 
ConcurrentDictionary<uintuintScores;
            public 
uint CapturerID;

            public 
Base(SobNpcSpawn flag)
            {
                
Flag flag;
                
Scores = new ConcurrentDictionary<uintuint>();
                
CapturerID 0;
            }

            public 
void Capture()
            {
                if (
Scores.Count == 0Scores.Add((uint)0, (uint)0);
                
uint guildId Scores.OrderByDescending(=> p.Value).FirstOrDefault().Key;
                
CapturerID guildId;
                var 
guild Kernel.Guilds[guildId];
                
Flag.Name guild.Name;
                
Flag.Hitpoints Flag.MaxHitpoints;
                
Kernel.SendScreen(FlagFlag);
                foreach (var 
player in Program.Values)
                {
                    if (
player.Entity.MapID == MapID)
                    {
                        
player.Send(generatePacket2(5, (Flag.UID 20570)));
                    }
                }
                
Scores.Clear();
            }
        }
        public const 
ushort MapID 2057;

        private 
Map Map;
        public 
Dictionary<uintBaseBases;
        public static 
bool IsWar;
        public static 
DateTime StartTime;

        public 
CaptureTheFlag()
        {
            
Bases = new Dictionary<uintBase>();
            if (!
Kernel.Maps.ContainsKey((int)2057L))
            {
                new 
Map(MapIDDMaps.MapPaths[MapID]);
            }
            
Map Kernel.Maps[MapID];
            foreach (var 
npc in Map.Npcs.Values)
                if (
npc is SobNpcSpawn)
                    
Bases.Add(npc.UID, new Base((SobNpcSpawn)npc));
            
SpawnFlags();
        }

        public 
void SpawnFlags()
        {
            
int toAdd 30 Map.StaticEntities.Count;
            for (
int i toAdd0i--)
            {
                var 
coords Map.RandomCoordinates();
                
StaticEntity entity = new StaticEntity((uint)(coords.Item1 1000 coords.Item2), coords.Item1coords.Item2MapID);
                
//System.Console.WriteLine("X : {0}  | Y : {1}", coords.Item1, coords.Item2);
                
entity.DoFlag();
                
Map.AddStaticEntity(entity);
            }
        }

        public 
bool SignUp(GameState client)
        {
            if (
client.Entity.GuildID == 0) return false;
            if (
client.Guild == null) return false;
            var 
coords Map.RandomCoordinates(48236727);
            
client.Entity.Teleport(MapIDcoords.Item1coords.Item2);
            return 
true;
        }

        public 
void AroundBase(GameState client)
        {
            if (
client.Entity.MapID != MapID) return;
            if (
client.Entity.GuildID == 0) return;
            if (
client.Guild == null) return;

            foreach (var 
_base in Bases.Values)
            {
                if (
Kernel.GetDistance(client.Entity.Xclient.Entity.Y_base.Flag.X_base.Flag.Y) == 9)
                {
                    if (
_base.CapturerID == client.Entity.GuildID)
                    {
                        if (
client.Entity.ContainsFlag2(Update.Flags2.CarryingFlag))
                        {
                            
client.Send(generateTimer(0));
                            
client.Send(generateEffect(client));
                            
client.Entity.RemoveFlag2(Update.Flags2.CarryingFlag);
                            
// client.Entity.nRemoveFlag(91);
                            
client.Guild.CTFPoints += 15;
                            
Program.World.CTF.SendUpdates();
                            
client.Send(generatePacket(7client.Entity.UID));
                            
client.AsMember.Exploits += (ushort)(client.Entity.Level 2);
                        }
                    }
                }
                else
                {
                    foreach (var 
item in client.Map.StaticEntities.Values)
                    {
                        if (
Kernel.GetDistance(item.Xitem.Yclient.Entity.Xclient.Entity.Y) == 0)
                        {
                            if (
client.Entity.ContainsFlag2(Update.Flags2.CarryingFlag))
                            {
                                
client.Entity.FlagStamp Time32.Now;

                                
client.Send(Program.World.CTF.generateTimer(60));
                                
client.Send(Program.World.CTF.generateEffect(client));
                                
client.Guild.CTFPoints += 3;
                                
client.Map.RemoveStaticItem(item);
                                
client.RemoveScreenSpawn(itemtrue);
                            }
                        }
                    }
                }
            }
        }

        public static 
bool Attackable(Game.Entity entity)
        {
            return 
Kernel.GetDistance(entity.Xentity.Y482367) > 32;
        }

        public 
void AddScore(uint damageGuild guildSobNpcSpawn attacked)
        {
            if (
Bases.ContainsKey(attacked.UID))
            {
                {
                    var 
_base Program.World.CTF.Bases[attacked.UID];
                    if (!
_base.Scores.ContainsKey(guild.ID))
                        
_base.Scores.Add(guild.IDdamage);
                    else
                        
_base.Scores[guild.ID] += damage;
                }


            }
        }

        public 
void FlagOwned(SobNpcSpawn attacked)
        {
            if (
Bases.ContainsKey(attacked.UID))
            {
                foreach (var 
player in Program.Values)
                {
                    if (
player.Entity.MapID == MapID)
                    {
                        
player.Send(generatePacket(5, (attacked.UID 20570)));
                    }
                }
            }
        }

        public static 
void Close()
        {
            foreach (var 
player in Program.Values)
                if (
player.Entity.MapID == MapID)
                    
player.Entity.Teleport(1002439390);

            var array = 
Kernel.Guilds.Values.Where(=> p.CTFPoints != 0).OrderByDescending(=> p.CTFPoints).ToArray();

            for (
int i 0Math.Min(8, array.Length); i++)
            {
                array[
i].CalculateCTFRANK(true);
                
Database.GuildTable.SaveCTFPoins(array[i]);

                if (
== 0)
                {
                    array[
i].CTFReward += 10;
                    array[
i].ConquerPointFund += 300000;
                    array[
i].SilverFund += 120000000;
                }
                else if (
== 1)
                {
                    array[
i].CTFReward += 9;
                    array[
i].ConquerPointFund += 250000;
                    array[
i].SilverFund += 100000000;
                }
                else if (
== 2)
                {
                    array[
i].CTFReward += 8;
                    array[
i].ConquerPointFund += 150000;
                    array[
i].SilverFund += 80000000;
                }
                else if (
== 3)
                {
                    array[
i].CTFReward += 7;
                    array[
i].ConquerPointFund += 100000;
                    array[
i].SilverFund += 65000000;
                }
                else if (
== 4)
                {
                    array[
i].CTFReward += 6;
                    array[
i].ConquerPointFund += 70000;
                    array[
i].SilverFund += 50000000;
                }
                else if (
== 5)
                {
                    array[
i].CTFReward += 5;
                    array[
i].ConquerPointFund += 50000;
                    array[
i].SilverFund += 40000000;
                }
                else if (
== 6)
                {
                    array[
i].CTFReward += 4;
                    array[
i].ConquerPointFund += 40000;
                    array[
i].SilverFund += 30000000;
                }
                else if (
== 7)
                {
                    array[
i].CTFReward += 3;
                    array[
i].ConquerPointFund += 30000;
                    array[
i].SilverFund += 20000000;
                }
                
Database.GuildTable.SaveCTFReward(array[i]);
                array[
i].CTFdonationCPs = array[i].CTFdonationCPsold;
                array[
i].CTFdonationSilver = array[i].CTFdonationSilverold;
                array[
i].CTFdonationCPsold 0;
                array[
i].CTFdonationSilverold 0;
            }
            if (array.
Length 8)
            {
                for (
int x 8< array.Lengthx++)
                {
                    array[
x].CTFPoints 0;
                    foreach (var 
meme in array[x].Members.Values)
                    {
                        
meme.Exploits 0;
                        
meme.ExploitsRank 0;
                    }
                }
            }
        }

        public 
void SendUpdates(GameState client)
        {
            if (
Time32.Now client.CTFUpdateStamp.AddSeconds(5))
            {
                
client.CTFUpdateStamp Time32.Now;
                var 
buffer generateCTFRanking4();
                
client.Send(buffer);
                foreach (var 
_base in Bases.Values)
                {
                    if (
Kernel.GetDistance(client.Entity.Xclient.Entity.Y_base.Flag.X_base.Flag.Y) <= 9)
                    {
                        
buffer generateFlagRanking(_base);
                        
client.Send(buffer);
                    }
                }
            }
        }

        public 
byte[] generateCTFRanking4()
        {
            var array = 
Kernel.Guilds.Values.Where(=> p.CTFPoints != 0).OrderByDescending(=> p.CTFPoints).ToArray();
            return 
generateList4(2, array, => p.CTFPoints);
        }

        public 
byte[] generateCTFRanking()
        {
            var array = 
Kernel.Guilds.Values.Where(=> p.CTFPoints != 0).OrderByDescending(=> p.CTFPoints).ToArray();
            return 
generateList(2, array, => p.CTFPoints);
        }

        private 
byte[] generateFlagRanking(Base flag)
        {
            var 
scores flag.Scores.OrderByDescending(=> p.Value).ToArray();
            var array = new 
Guild[Math.Min(5scores.Length)];
            for (
int i 0< array.Lengthi++)
            {
                array[
i] = Kernel.Guilds[scores[i].Key];
                array[
i].CTFFlagScore scores[i].Value;
            }
            return 
generateList(1, array, => p.CTFFlagScore);
        }

        private 
byte[] generateList(int typeGuild[] array = nullFunc<GuildUInt32select null)
        {
            
byte[] data null;
            if (array == 
null)
                
data = new byte[48];
            else
                
data = new byte[48 + (array.Length 24)];
            
Writer.WriteInt32(data.Length 80data);
            
Writer.WriteUInt16(22242data);
            
Writer.WriteInt32(type4data);
            if (array != 
null)
            {
                
Writer.WriteInt32(array.Length28data);
                for (
int i 0< array.Lengthi++)
                {
                    
int offset 32 + (24);
                    
Writer.WriteInt32(ioffsetdata); offset += 4;
                    
Writer.WriteUInt32(select(array[i]), offsetdata); offset += 4;
                    
Writer.WriteString(array[i].Nameoffsetdata); offset += 16;
                }
            }
            return 
data;
        }
        private 
byte[] generateList4(int typeGuild[] array = nullFunc<GuildUInt32select null)
        {
            
byte[] data null;
            if (array == 
null)
                
data = new byte[48 4];
            else
                
data = new byte[48 + (array.Length 24)];
            
Writer.WriteInt32(data.Length 80data);
            
Writer.WriteUInt16(22242data);
            
Writer.WriteInt32(type4data);
            if (array != 
null)
            {
                
Writer.WriteInt32(array.Length28 4data);
                for (
int i 0< array.Lengthi++)
                {
                    
int offset 32 + (24);
                    
Writer.WriteInt32(ioffsetdata); offset += 4;
                    
Writer.WriteUInt32(select(array[i]), offsetdata); offset += 4;
                    
Writer.WriteString(array[i].Nameoffsetdata); offset += 16;

                }
            }
            return 
data;
        }

        public 
byte[] generateTimer(uint time)
        {
            return 
generatePacket(8time);
        }

        public 
byte[] generateEffect(GameState Client)
        {
            
//return generatePacket3(6, 6327607);
            
return generatePacket(6Client.Entity.UID);
        }

        private 
byte[] generatePacket(int typeuint dwParam)
        {
            
byte[] data = new byte[48];
            
Writer.WriteInt32(data.Length 80data);
            
Writer.WriteUInt16(22242data);
            
Writer.WriteInt32(type4data);
            
Writer.WriteUInt32(dwParam8data);
            return 
data;
        }

        public static 
byte[] generatePacket2(int typeuint dwParam)
        {
            
byte[] data = new byte[48];
            
Writer.WriteInt32(data.Length 80data);
            
Writer.WriteUInt16(22242data);
            
Writer.WriteInt32(type4data);
            
Writer.WriteUInt32(dwParam8data);
            return 
data;
        }

        public 
void SendUpdates()
        {
            foreach (var 
player in Program.Values)
                if (
player.Entity.MapID == MapID)
                    
SendUpdates(player);
        }

        public 
void CloseList(GameState client)
        {
            
client.Send(generateList(3));
        }



        public static 
void CTFGuildsRank(GameState clientbyte[] packet)
        {
            var array = 
Kernel.Guilds.Values.Where(=> p.CTFPoints != 0).OrderByDescending(=> p.CTFPoints).ToArray();

            const 
byte maxcount 5;
            
byte page packet[10];

            if (array.
Length == 0)
                return;

            
byte[] buffer = new byte[908];
            
Writer.WriteUInt16(9000buffer);
            
Writer.WriteUInt16(10632buffer);
            
Writer.WriteUInt16(04buffer);
            
Writer.WriteUInt32(16buffer);
            
Writer.WriteUInt32((uint)(array.Length), 10buffer);
            
Writer.WriteUInt32((uint)(array.Length), 14buffer);

            
Writer.WriteUInt32(client.Guild.CTFdonationCPsold18buffer);
            
Writer.WriteUInt64((ulong)client.Guild.CTFdonationSilverold22buffer);

            
int offset 30;
            for (
ushort x = (ushort)(page maxcount maxcount); page maxcountx++)
            {
                if (
>= array.Length) break;
                var 
guild = array[x];
                
Writer.WriteUInt32(guild.CTFdonationCPsoffsetbuffer);
                
offset += 4;
                
Writer.WriteUInt64((ulong)guild.CTFdonationSilveroffsetbuffer);
                
offset += 8;
                
Writer.WriteString(guild.Nameoffsetbuffer);
                
offset += 0x24;
                
Writer.WriteUInt32(guild.IDoffsetbuffer);
                
offset += 4;
            }
            
client.Send(buffer);
        }

        public static 
void CTFGuildsRank2(GameState clientbyte[] packet)
        {
            const 
byte maxcount 5;
            
byte page packet[10];


            var 
guild_array Kernel.Guilds.Values.Where(=> p.CTFPoints != 0).OrderByDescending(=> p.CTFPoints).ToArray();
            if (
guild_array.Length == 0)
                return;
            
byte[] buffer2 = new byte[0x38c];
            
Writer.WriteUInt16(9000buffer2);
            
Writer.WriteUInt16(0x4272buffer2);
            
Writer.WriteUInt16(04buffer2);
            
Writer.WriteUInt16(page6buffer2);
            
Writer.WriteUInt32(1010buffer2);
            
Writer.WriteUInt32((uint)guild_array.Length14buffer2);
            
client.Guild client.AsMember.Guild;
            
Writer.WriteUInt32(client.Guild.CTFdonationCPsold0x12buffer2);
            
Writer.WriteUInt64((ulong)client.Guild.CTFdonationSilverold0x16buffer2);
            
ushort offset 30;

            for (
ushort x = (ushort)(page maxcount maxcount); page maxcountx++)
            {
                if (
>= guild_array.Length) break;
                var 
guild guild_array[x];
                
Writer.WriteUInt32(guild.CTFdonationCPsoldoffsetbuffer2);
                
offset += 4;
                
Writer.WriteUInt64((ulong)guild.CTFdonationSilveroldoffsetbuffer2);
                
offset += 8;
                
Writer.WriteString(guild.Nameoffsetbuffer2);
                
offset += 0x24;
                
Writer.WriteUInt32(guild.IDoffsetbuffer2);
                
offset += 4;
            }

            
client.Send(buffer2);
        }

        public static 
void CTFsRank(GameState clientbyte[] packet)
        {
            var array = 
Kernel.Guilds.Values.Where(=> p.CTFPoints != 0).OrderByDescending(=> p.CTFPoints).ToArray();
            
byte[] Packet = new byte[356];
            
Writer.WriteUInt16(3480Packet);
            
Writer.WriteUInt16(10632Packet);
            
Packet[4] = 9;//type
            
Packet[6] = 1// count
            
Packet[14] = 8// count
            
ushort index 26;
            
Writer.WriteUInt32(client.Entity.UID18Packet);
            for (
byte i 0< array.Lengthi++)
            {
                if (
>= 8)
                    break;
                if (
>= array.Length)
                    break;
                var 
guild = array[i];
                
Packet[index] = (byte)(1);
                
index = (ushort)(index 4);
                
Writer.WriteString(guild.NameindexPacket);
                
index = (ushort)(index 16);
                
Writer.WriteUInt32(guild.CTFPointsindexPacket);
                
index = (ushort)(index 4);
                
Writer.WriteUInt32(guild.MemberCountindexPacket);
                
index = (ushort)(index 12);
            }
            
client.Send(Packet);
        }

        public static 
void CTFExpolitsRank(GameState clientbyte[] packet)
        {
            
byte page packet[10];

            var array = 
client.Guild.Members.Values.Where(=> p.Exploits != 0).OrderByDescending(=> p.Exploits).ToArray();
            if (array.
Length == 0)
                return;

            
byte[] buffer = new byte[0x38c];
            
Writer.WriteUInt16(9000buffer);
            
Writer.WriteUInt16(0x4272buffer);
            
Writer.WriteUInt16(84buffer);
            
Writer.WriteUInt32(page6buffer);
            
Writer.WriteUInt32((uint)array.Length10buffer);
            
Writer.WriteUInt32(814buffer);
            
Writer.WriteUInt32(client.AsMember.Exploits0x12buffer);
            
int offset 30;
            for (
ushort x 0< array.Lengthx++)//(ushort)(page * maxcount - maxcount); x < page * maxcount; x++)
            
{
                if (
20)
                    break;
                if (
>= array.Length) break;
                var 
member = array[x];
                
Writer.WriteString(member.Nameoffsetbuffer);
                
offset += 0x10;

                
Writer.WriteUInt32(member.Exploitsoffsetbuffer);
                
offset += 4;
            }
            
client.Send(buffer);
        }

        public static 
void CTFExpolitsRank2(GameState clientbyte[] packet)
        {
            const 
byte maxcount 5;
            
byte page packet[10];

            var array = 
client.Guild.Members.Values.Where(=> p.Exploits != 0).OrderByDescending(=> p.Exploits).ToArray();
            if (array.
Length == 0)
                return;

            
byte[] buffer = new byte[0x38c];
            
Writer.WriteUInt16(9000buffer);
            
Writer.WriteUInt16(0x4272buffer);
            
Writer.WriteUInt16(14buffer);
            
Writer.WriteUInt32(page6buffer);
            
Writer.WriteUInt32((uint)array.Length10buffer);
            
Writer.WriteUInt32(514buffer);
            
Writer.WriteUInt32(client.Guild.CTFdonationCPsold0x12buffer);
            
Writer.WriteUInt64((ulong)client.Guild.CTFdonationSilverold0x16buffer);

            
Writer.WriteUInt32((ushort)array.Length30buffer);

            
int offset 30;

            for (
ushort x = (ushort)(page maxcount maxcount); page maxcountx++)
            {
                if (
>= array.Length) break;
                var 
member = array[x];
                
Writer.WriteUInt32((ushort)(1), offsetbuffer);
                
offset += 4;

                
Writer.WriteUInt32(member.Exploitsoffsetbuffer);
                
offset += 4;
                
Writer.WriteUInt32(member.CTFCpsRewardoffsetbuffer);
                
offset += 4;
                
Writer.WriteUInt64(member.CTFSilverRewardoffsetbuffer);
                
offset += 8;
                
Writer.WriteUInt32(member.IDoffsetbuffer);
                
offset += 4;
                
Writer.WriteString(member.Nameoffsetbuffer);
                
offset += 0x24;
            }
            
client.Send(buffer);
        }
    }



قديم 2019-12-02, 01:31 AM
المشاركة 3
Hassan Emprator
.:: عضو خبير ::.
  • غير متواجد
افتراضي رد: ايرور عند اضافة الاوتو انفيت بتاع الفلاج
ولو هيجيلك ايرورات ضيف دول في الكلاس عندك


كود:
public static void Close()
        {
            foreach (var 
player in Program.Values)
                if (
player.Entity.MapID == MapID)
                    
player.Entity.Teleport(1002439390);

            var array = 
Kernel.Guilds.Values.Where(=> p.CTFPoints != 0).OrderByDescending(=> p.CTFPoints).ToArray();

            for (
int i 0Math.Min(8, array.Length); i++)
            {
                array[
i].CalculateCTFRANK(true);
                
Database.GuildTable.SaveCTFPoins(array[i]);

                if (
== 0)
                {
                    array[
i].CTFReward += 10;
                    array[
i].ConquerPointFund += 300000;
                    array[
i].SilverFund += 120000000;
                }
                else if (
== 1)
                {
                    array[
i].CTFReward += 9;
                    array[
i].ConquerPointFund += 250000;
                    array[
i].SilverFund += 100000000;
                }
                else if (
== 2)
                {
                    array[
i].CTFReward += 8;
                    array[
i].ConquerPointFund += 150000;
                    array[
i].SilverFund += 80000000;
                }
                else if (
== 3)
                {
                    array[
i].CTFReward += 7;
                    array[
i].ConquerPointFund += 100000;
                    array[
i].SilverFund += 65000000;
                }
                else if (
== 4)
                {
                    array[
i].CTFReward += 6;
                    array[
i].ConquerPointFund += 70000;
                    array[
i].SilverFund += 50000000;
                }
                else if (
== 5)
                {
                    array[
i].CTFReward += 5;
                    array[
i].ConquerPointFund += 50000;
                    array[
i].SilverFund += 40000000;
                }
                else if (
== 6)
                {
                    array[
i].CTFReward += 4;
                    array[
i].ConquerPointFund += 40000;
                    array[
i].SilverFund += 30000000;
                }
                else if (
== 7)
                {
                    array[
i].CTFReward += 3;
                    array[
i].ConquerPointFund += 30000;
                    array[
i].SilverFund += 20000000;
                }
                
Database.GuildTable.SaveCTFReward(array[i]);
                array[
i].CTFdonationCPs = array[i].CTFdonationCPsold;
                array[
i].CTFdonationSilver = array[i].CTFdonationSilverold;
                array[
i].CTFdonationCPsold 0;
                array[
i].CTFdonationSilverold 0;
            }
            if (array.
Length 8)
            {
                for (
int x 8< array.Lengthx++)
                {
                    array[
x].CTFPoints 0;
                    foreach (var 
meme in array[x].Members.Values)
                    {
                        
meme.Exploits 0;
                        
meme.ExploitsRank 0;
                    }
                }
            }
        }

        public 
void SendUpdates(GameState client)
        {
            if (
Time32.Now client.CTFUpdateStamp.AddSeconds(5))
            {
                
client.CTFUpdateStamp Time32.Now;
                var 
buffer generateCTFRanking4();
                
client.Send(buffer);
                foreach (var 
_base in Bases.Values)
                {
                    if (
Kernel.GetDistance(client.Entity.Xclient.Entity.Y_base.Flag.X_base.Flag.Y) <= 9)
                    {
                        
buffer generateFlagRanking(_base);
                        
client.Send(buffer);
                    }
                }
            }
        } 

وضيف دي في نفس الكلاس برضو

كود:
public static DateTime StartTime

وفي GameState

ضيف


كود:
public Time32 CTFUpdateStamp


قديم 2019-12-02, 01:42 AM
المشاركة 4
nova
.:: عضو مميز ::.
  • غير متواجد
افتراضي رد: ايرور عند اضافة الاوتو انفيت بتاع الفلاج
ولو هيجيلك ايرورات ضيف دول في الكلاس عندك


كود:
public static void Close()
        {
            foreach (var 
player in Program.Values)
                if (
player.Entity.MapID == MapID)
                    
player.Entity.Teleport(1002439390);

            var array = 
Kernel.Guilds.Values.Where(=> p.CTFPoints != 0).OrderByDescending(=> p.CTFPoints).ToArray();

            for (
int i 0Math.Min(8, array.Length); i++)
            {
                array[
i].CalculateCTFRANK(true);
                
Database.GuildTable.SaveCTFPoins(array[i]);

                if (
== 0)
                {
                    array[
i].CTFReward += 10;
                    array[
i].ConquerPointFund += 300000;
                    array[
i].SilverFund += 120000000;
                }
                else if (
== 1)
                {
                    array[
i].CTFReward += 9;
                    array[
i].ConquerPointFund += 250000;
                    array[
i].SilverFund += 100000000;
                }
                else if (
== 2)
                {
                    array[
i].CTFReward += 8;
                    array[
i].ConquerPointFund += 150000;
                    array[
i].SilverFund += 80000000;
                }
                else if (
== 3)
                {
                    array[
i].CTFReward += 7;
                    array[
i].ConquerPointFund += 100000;
                    array[
i].SilverFund += 65000000;
                }
                else if (
== 4)
                {
                    array[
i].CTFReward += 6;
                    array[
i].ConquerPointFund += 70000;
                    array[
i].SilverFund += 50000000;
                }
                else if (
== 5)
                {
                    array[
i].CTFReward += 5;
                    array[
i].ConquerPointFund += 50000;
                    array[
i].SilverFund += 40000000;
                }
                else if (
== 6)
                {
                    array[
i].CTFReward += 4;
                    array[
i].ConquerPointFund += 40000;
                    array[
i].SilverFund += 30000000;
                }
                else if (
== 7)
                {
                    array[
i].CTFReward += 3;
                    array[
i].ConquerPointFund += 30000;
                    array[
i].SilverFund += 20000000;
                }
                
Database.GuildTable.SaveCTFReward(array[i]);
                array[
i].CTFdonationCPs = array[i].CTFdonationCPsold;
                array[
i].CTFdonationSilver = array[i].CTFdonationSilverold;
                array[
i].CTFdonationCPsold 0;
                array[
i].CTFdonationSilverold 0;
            }
            if (array.
Length 8)
            {
                for (
int x 8< array.Lengthx++)
                {
                    array[
x].CTFPoints 0;
                    foreach (var 
meme in array[x].Members.Values)
                    {
                        
meme.Exploits 0;
                        
meme.ExploitsRank 0;
                    }
                }
            }
        }

        public 
void SendUpdates(GameState client)
        {
            if (
Time32.Now client.CTFUpdateStamp.AddSeconds(5))
            {
                
client.CTFUpdateStamp Time32.Now;
                var 
buffer generateCTFRanking4();
                
client.Send(buffer);
                foreach (var 
_base in Bases.Values)
                {
                    if (
Kernel.GetDistance(client.Entity.Xclient.Entity.Y_base.Flag.X_base.Flag.Y) <= 9)
                    {
                        
buffer generateFlagRanking(_base);
                        
client.Send(buffer);
                    }
                }
            }
        } 

وضيف دي في نفس الكلاس برضو

كود:
public static DateTime StartTime

وفي GameState

ضيف


كود:
public Time32 CTFUpdateStamp
الايرور فى دول بس يا حسن

قديم 2019-12-02, 01:44 AM
المشاركة 5
Hassan Emprator
.:: عضو خبير ::.
  • غير متواجد
افتراضي رد: ايرور عند اضافة الاوتو انفيت بتاع الفلاج
ابعت اني ديسك خاص

قديم 2019-12-02, 01:45 AM
المشاركة 6
nova
.:: عضو مميز ::.
  • غير متواجد
افتراضي رد: ايرور عند اضافة الاوتو انفيت بتاع الفلاج
تمام هبعت حالا

قديم 2019-12-02, 02:43 AM
المشاركة 7
Hassan Emprator
.:: عضو خبير ::.
  • غير متواجد
افتراضي رد: ايرور عند اضافة الاوتو انفيت بتاع الفلاج
تم حل المشكله خاصص


العلامات المرجعية



الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1)
 

الانتقال السريع

المواضيع المتشابهه للموضوع: ايرور عند اضافة الاوتو انفيت بتاع الفلاج
الموضوع كاتب الموضوع المنتدى مشاركات آخر مشاركة
صنع كود اوتو انفيت لسورس 5095 Tefa تطوير سورسات 5095 4 2024-06-10 08:31 PM
طلب كود اوتو انفيت لسورس 5095 shehabdasten مشكلات السيرفيرات كونكر الشخصيه 2 2020-02-17 08:16 AM
بخصوص حرب الفلاج nova مشكلات السيرفيرات كونكر الشخصيه 9 2019-12-07 10:02 PM
مشكلة ف الاوتو انفيت الكابتشر فلاج nova مشكلات السيرفيرات كونكر الشخصيه 1 2019-12-05 03:26 PM
عمل اوتو انفيت للحرب Users تطوير سيرفرات كونكر 1 2019-07-14 02:30 AM


الساعة الآن 09:04 AM

Powered by vBulletin® Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.