Originally Posted by
varrattu
Sorry to say:
C# cannot implicitly convert "(actor as AiCart).CrewFunctionPlace(placeIndex)" to "int crewFunctionNum".
~V~
Aack, I must have copy-pasted something halfway finished. The exact line I was using successfully:
Code:
//string PlayerPlace = Enum.GetName(typeof(CrewFunction), (actor as AiCart).CrewFunctionPlace(placeIndex));
A fixed version of the above code (maybe, I haven't tested it):
Code:
public override void OnPlaceEnter(Player player, AiActor actor, int placeIndex) {
base.OnPlaceEnter(player, actor, placeIndex);
int crewFunctionNum = (actor as AiCart).CrewFunctionPlace(placeIndex);
string PlayerPlace = Enum.GetName(typeof(crewFunction), crewFunctionNum );
//tells the name of the position the player just entered - Pilot, Bombardier, Nose Gunner, etc.
GamePlay.gpHUDLogCenter(PlayerPlace + " " + placeIndex.ToString("F0") + " " + crewFunctionNum.ToString ("F0"));
}
Bookmarks