PDA

View Full Version : Player Health


frantic69
08-30-2012, 05:00 PM
Hello,

I checked a lot of the DLL methods but I can't see how to read and set the player's health level. Does anyone have any information regarding this point ? If you have a little script example, that will be perfect.

Thanks

FG28_Kodiak
08-30-2012, 05:26 PM
You can't set the health level, only read:
float Health { get; }

Example Code

AiPerson singlePlayer = GamePlay.gpPlayer() as AiPerson;
GamePlay.gpLogServer(null, "Person Health: {0}", new object[] { singlePlayer.Health });

frantic69
08-30-2012, 06:30 PM
Hello Kodiak,

Thank you for the information. Understood about the fact that it is impossible to set the player's health but, from your point of view, how do you think the game manage the player when he is wounded ? I mean, when you get hit, you see red (if not completely dead). So I think this is managed somehow ?

FG28_Kodiak
08-30-2012, 06:45 PM
If a player (AiPerson) is wounded

public override void OnPersonHealth(AiPerson person, AiDamageInitiator initiator, float deltaHealth)
{
base.OnPersonHealth(person, initiator, deltaHealth);

}

is called. deltaHealth is the value how strongly the person is wounded.

frantic69
08-30-2012, 07:05 PM
thank you Kodiak. It should have been nice to be able to set freely the player health or wounded level but it already have the method you specified.

Thank you
Frantic

FG28_Kodiak
08-30-2012, 08:35 PM
You can damage the aircraft but not the player via script :rolleyes:

Smokeynz
08-30-2012, 10:23 PM
Yes break the wings off and soon the pilot health will be poor:-P