//test warning level
if(Id == 1 || Id == 5 || Id == 9){
if (Users[userId].GetMap().FactionId != Users[userId].Ship.FactionId)
{
level_warning++;
}
if (Users[userId].GetMap().FactionId == Users[userId].Ship.FactionId)
{
Users[userId].Send("0|n|w|" + level_warning);
}
}
You should calculate level_warning before sending the packet.Quote:
Mmmm how improve this shi*?
Code://test warning level if(Id == 1 || Id == 5 || Id == 9){ if (Users[userId].GetMap().FactionId != Users[userId].Ship.FactionId) { level_warning++; } if (Users[userId].GetMap().FactionId == Users[userId].Ship.FactionId) { Users[userId].Send("0|n|w|" + level_warning); } }
Can you put a example? :confused: :handsdown:Quote:
You should calculate level_warning before sending the packet.
In your code, if there's an enemy at the last of the iteration, lvl_warning won't be 1 to the others.
if (Id == 1 || Id == 5 || Id == 9)
{
var map = Users[userId].MapId;
if (Users[userId].GetMap().FactionId != Users[userId].Ship.FactionId)
{
var x = Program.GameManager.Maps[map].Users.Count;
if (x == 1)
{
level_warning = 1;
}
else if (x == 2)
{
level_warning = 2;
}
else if (x == 3)
{
level_warning = 3;
}
else if (x == 4)
{
level_warning = 4;
}
else if (x >= 5)
{
level_warning = 5;
}
}
}
Just truncated the checking part xDQuote:
Can you put a example? :confused: :handsdown:
Is a little hard for me..
My bugged code for calculate enemy
Code:if (Id == 1 || Id == 5 || Id == 9) { var map = Users[userId].MapId; if (Users[userId].GetMap().FactionId != Users[userId].Ship.FactionId) { var x = Program.GameManager.Maps[map].Users.Count; if (x == 1) { level_warning = 1; } else if (x == 2) { level_warning = 2; } else if (x == 3) { level_warning = 3; } else if (x == 4) { level_warning = 4; } else if (x >= 5) { level_warning = 5; } } }
if (Id == 1 || Id == 5 || Id == 9)
{
var map = Users[userId].MapId;
if (Users[userId].GetMap().FactionId != Users[userId].Ship.FactionId)
{
level_warning = Program.GameManager.Maps[map].Users.Count;
}
}
the main problem is that I have to count only users with different factionid from the mapQuote:
Just truncated the checking part xD
Code:if (Id == 1 || Id == 5 || Id == 9) { var map = Users[userId].MapId; if (Users[userId].GetMap().FactionId != Users[userId].Ship.FactionId) { level_warning = Program.GameManager.Maps[map].Users.Count; } }
Something likeQuote:
the main problem is that I have to count only users with different factionid from the map
var user = Users[userId];
var map = Users[userId].GetMap();
var ennemiesCount = map.Users.Count(u=>u.Ship.FactionId != map.FactionId);
user.Send("0|n|w|" + (ennemiesCount > 5) ? 5 : ennemiesCount);
public void MsginChat(string MSG, string Name)
{
foreach (var pair in Program.chatUsers)
{
if (pair.Value.ChatsJoined.Contains(Convert.ToInt32(250)))
{
pair.Value.Send("j%250@" + Name + "@" + MSG + "#");
}
}
}
Instead of checking it every time, why not updating it when the enemy enters the map?Quote:
Because when I use this method, I send the message as many times as there are users in chat?? :confused:
I'm new to programming , sorryCode:public void MsginChat(string MSG, string Name) { foreach (var pair in Program.chatUsers) { if (pair.Value.ChatsJoined.Contains(Convert.ToInt32(250))) { pair.Value.Send("j%250@" + Name + "@" + MSG + "#"); } } }
if(!user.isInEnemyMap() && !map.isStarter()) {
return;
}
enemies.add(user);
StarterMapEnemyCount packet = new StarterMapEnemyCount(enemies.count());
map.broadcastPacket(packet);
Hi manulaiko3.0 i sloved with:Quote:
Instead of checking it every time, why not updating it when the enemy enters the map?
Code:if(!user.isInEnemyMap() && !map.isStarter()) { return; } enemies.add(user); StarterMapEnemyCount packet = new StarterMapEnemyCount(enemies.count()); map.broadcastPacket(packet);
//in patchfinder
if (_user.GetMap().IsStarterMap)
{
_user.GetMap().CalculWarningmap(_userId);
if (_user.GetMap().FactionId == _user.Ship.FactionId)
{
if (_user.GetMap().FactionId == 1) _user.Send("0|n|w|" + Map.level_warningmmo);
else if(_user.GetMap().FactionId == 2)_user.Send("0|n|w|" + Map.level_warningeic);
else if (_user.GetMap().FactionId == 3) _user.Send("0|n|w|" + Map.level_warningvru);
}
}
else
{
_user.Send("0|n|w|0");
}
public void CalculWarningmap(uint userId)
{
var user = Program.GameManager.Users[userId];
var map = Users[userId].GetMap();
if (map.IsStarterMap)
{
if (user.Ship.FactionId == 1) { level_warningmmo = map.Users.Count(u => u.Value.Ship.FactionId != map.FactionId); }
else if (user.Ship.FactionId == 2) { level_warningeic = map.Users.Count(u => u.Value.Ship.FactionId != map.FactionId); }
else { level_warningvru = map.Users.Count(u => u.Value.Ship.FactionId != map.FactionId); }
}
}
public void MsginChat(string MSG, string Name)
{
foreach (var pair in Program.chatUsers)
{
if (pair.Value.ChatsJoined.Contains(Convert.ToInt32(250)))
{
pair.Value.Send("j%250@" + Name + "@" + MSG + "#");
}
}
}
The problem is the file Doesn't exists or your File Directory is incorrect.Quote:
Can someone help me ?
Warning: require(/KERNEL-DOCMS/Init.php): failed to open stream: No such file or directory in C:\xampp\htdocs\index.php on line 2
Fatal error: require(): Failed opening required '/KERNEL-DOCMS/Init.php' (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\index.php on line 2
Im using 1.0 files