![]() |
|
|||||||
| CoD Multiplayer Everything about multiplayer in IL-2 CoD |
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Alright, one more try.
Code:
if (GamePlay.gpAirGroups(1) != null && GamePlay.gpAirGroups(2) != null)
{
if (Time.tickCounter() % 9000 == 0)
{
int totalAircraft = GamePlay.gpAirGroups(1).Length + GamePlay.gpAirGroups(2).Length;
if(GamePlay.gpPlayer().Length > 0)
{
GamePlay.gpLogServer(new Player[] { GamePlay.gpPlayer() }, totalAircraft.ToString(), null);
}
if(GamePlay.gpRemotePlayers().Length > 0)
{
GamePlay.gpLogServer(GamePlay.gpRemotePlayers(), totalAircraft.ToString(), null);
}
}
}
Code:
if (GamePlay.gpAirGroups(1) != null && GamePlay.gpAirGroups(2) != null)
{
if (Time.tickCounter() % 9000 == 0)
{
int totalAircraft = GamePlay.gpAirGroups(1).Length + GamePlay.gpAirGroups(2).Length;
if(GamePlay.gpPlayer() != null)
{
GamePlay.gpLogServer(new Player[] { GamePlay.gpPlayer() }, totalAircraft.ToString(), null);
}
}
}
|
|
#2
|
|||
|
|||
|
For testing i am running a dedi server and joining it with a client from the same PC. I got error messages before joining the server.
It would be nice to have it working on a dedi server. Will try the latest version later. Thank you for your input. |
|
#3
|
|||
|
|||
|
I'm sorry it's not working right. The server log methods are a little confusing to me. Tomorrow, I'll see if I can find a better solution.
|
|
#4
|
|||
|
|||
|
Your efforts are appreciated...as for me, I haven't a bloody clue! Im just muddling along trying to get a mission to work!
Thanks |
|
#5
|
|||
|
|||
|
Now it is better.
It says "maddox.game.Player" does not contain definition for "Length" Code:
[20:55:59] ================================================= [20:55:59] System.Exception: c:\Users\Andy\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\missions\Multi\Dogfight\BoF1\BoF_1_main1_7.cs(105,37): error CS1061: "maddox.game.Player" не содержит определение для "Length". Не удалось найти метод расширения "Length", принимающий первый аргумент типа "maddox.game.Player" (пропущено использование директивы или ссылка на сборку?) [20:55:59] [20:55:59] в W95BpjQhQGdapXjq6AD.Y79VY6QHpIXBu63gDbj.DNrbvsoLYTD(String , Boolean , Boolean ) [20:55:59] в W95BpjQhQGdapXjq6AD.Y79VY6QHpIXBu63gDbj.3Iw2CLCaNTnBeBq9j1Yy(Object , Boolean , Boolean ) [20:55:59] в W95BpjQhQGdapXjq6AD.Y79VY6QHpIXBu63gDbj.XBibvrRFwOK(String ) [20:55:59] в W95BpjQhQGdapXjq6AD.Y79VY6QHpIXBu63gDbj.b2WbvifgeN1(String , Int32 ) [20:55:59] ================================================= [20:55:59] [20:55:59] ================================================= [20:55:59] System.Exception: c:\Users\Andy\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\missions\Multi\Dogfight\BoF1\BoF_1_main1_7.cs(105,37): error CS1061: "maddox.game.Player" не содержит определение для "Length". Не удалось найти метод расширения "Length", принимающий первый аргумент типа "maddox.game.Player" (пропущено использование директивы или ссылка на сборку?) [20:55:59] [20:55:59] в W95BpjQhQGdapXjq6AD.Y79VY6QHpIXBu63gDbj.b2WbvifgeN1(String , Int32 ) [20:55:59] в PvIUEjqHoL1yDhuyUY9.KErMihqBkLOM7gFVKGE.1sOBZ4gmJ3(MTsEYPOQbCed3fk571y ) [20:55:59] ================================================= |
|
#6
|
|||
|
|||
|
Alright, I finally have a solution. This won't send a message to the server, but it will appear in the server logs as something like "server to [username]: ". It will appear every five minutes for everybody connected to the server. You can decrease the time interval by changing 9000 to a lower number.
As a reminder, this code goes in the OnTickGame() method and both sides have to have at least one aircraft. I hope this helps. Code:
if (GamePlay.gpAirGroups(1) != null && GamePlay.gpAirGroups(2) != null)
{
if (Time.tickCounter() % 9000 == 0)
{
int totalAircraft = GamePlay.gpAirGroups(1).Length + GamePlay.gpAirGroups(2).Length;
if (GamePlay.gpRemotePlayers().Length > 0)
{
GamePlay.gpLogServerBegin(GamePlay.gpRemotePlayers(), totalAircraft.ToString());
GamePlay.gpLogServerEnd();
}
}
}
Last edited by TheEnlightenedFlorist; 05-29-2011 at 03:05 AM. |
|
#7
|
|||
|
|||
|
Quote:
This error occurs when you try to call a method or access a class member that does not exist.
__________________
Gigabyte Z68 Intel 2500K (@4.3 ghz)212 CM Cooler 8GB Ram EVGA 660SC (super clocked) 2GB Vram CORSAIR CMPSU-750TX 750W 64 GB SSD SATA II HD WIN7 UL 64BIT |
|
#8
|
|||
|
|||
|
Quote:
My latest snippet of code should work though. |
![]() |
|
|