![]() |
|
|||||||
| CoD Multiplayer Everything about multiplayer in IL-2 CoD |
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Added scripts to remove abandoned and crashlanded planes.
Code:
using System;
using maddox.game;
using maddox.game.world;
using System.Collections.Generic;
public class Mission : AMission
{
// loads my sub-missions
public override void OnTickGame()
{
if (Time.tickCounter() % 72000 == 18000) // 40-10
{
GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/128BoF/128BoFsmGroundv1_0.mis");
GamePlay.gpHUDLogCenter("Protect friendly shipping in the channel near France!");
}
if (Time.tickCounter() % 72000 == 71999) // 40-40
{
GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/128BoF/128BoFsmBombersv1_0.mis");
GamePlay.gpHUDLogCenter("Intel: Enemy bombers are heading to blue airfields!");
}
if (Time.tickCounter() % 72000 == 45000) // 40-25
{
GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/128BoF/128BoFsmBombersv1_0a.mis");
GamePlay.gpHUDLogCenter("Intel: Enemy bombers are heading to red airfields in France!");
}
}
// destroys aircraft abandoned by a player
public void _DespawnEmptyPlane(AiActor actor)
{
if (actor == null)
{ return; }
Player[] Players = GamePlay.gpRemotePlayers();
bool PlaneIsEmpty = true;
foreach (Player i in Players)
{
if ((i.Place() as AiAircraft) == (actor as AiAircraft))
{
PlaneIsEmpty = false;
break;
}
}
if ((PlaneIsEmpty) && (actor as AiAircraft).IsAirborne())
{
(actor as AiAircraft).hitNamed(part.NamedDamageTypes.ControlsElevatorDisabled);
(actor as AiAircraft).hitNamed(part.NamedDamageTypes.ControlsAileronsDisabled);
(actor as AiAircraft).hitNamed(part.NamedDamageTypes.ControlsRudderDisabled);
(actor as AiAircraft).hitNamed(part.NamedDamageTypes.Eng0TotalFailure);
//for 2mots
(actor as AiAircraft).hitNamed(part.NamedDamageTypes.Eng1TotalFailure);
//then wait 10min
Timeout(600.0, () =>
{
(actor as AiAircraft).Destroy();
});
}
else if (PlaneIsEmpty)
{
(actor as AiAircraft).Destroy();
}
}
public override void OnPlaceLeave(Player player, AiActor actor, int placeIndex)
{
base.OnPlaceLeave(player, actor, placeIndex);
_DespawnEmptyPlane(actor);
}
// destroys crushlanded aircraft in 10 minutes
public override void OnAircraftCrashLanded(int missionNumber, string shortName, AiAircraft aircraft)
{
base.OnAircraftCrashLanded(missionNumber, shortName, aircraft);
Timeout(600, () =>
{
aircraft.Destroy();
});
}
}
|
|
#2
|
|||
|
|||
|
your really getting into the C programing Ataros
where is a list of all the verbage..like gppostmissionload or gameplay.??? or gpHUDlogcenter.... thnx
__________________
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 Last edited by Thee_oddball; 04-28-2011 at 02:30 AM. |
|
#3
|
|||
|
|||
|
Very nice job Ataros
|
|
#4
|
|||
|
|||
|
Sorry, I did not mention that all credits and many thanks go to FG28_Kodiak http://forum.1cpublishing.eu/showpos...8&postcount=41
and ZaltysZ http://forum.1cpublishing.eu/showpos...5&postcount=16 because I assumed everyone interested followed that thread. The part "// destroys crushlanded aircraft in 10 minutes" came directly from developers at sukhoi.ru forums. I know nothing on C# besides copy-and-paste to Microsoft Visual C# 2010 Express. Please feel free to use and modify the scripts. Last edited by Ataros; 04-28-2011 at 10:34 AM. |
|
#5
|
|||
|
|||
|
Thanks for the server, tried it yesterday but had major issues.
Choose red, and every time i spawned my plane would blow up or get turned upside-down. Tried 5 or 6 times, using different spawn points and different planes. I gave up in the end and left the server. |
|
#6
|
|||
|
|||
|
Quote:
This is the map issue which we can not edit and the Devs are working on it. Do not give up. If I explode I hit create again immediately and spawn at a good location the 2nd time. Try a new version tonight please. |
|
#7
|
|||
|
|||
|
Quote:
Thanks again for the server. |
![]() |
|
|