View Single Post
  #1  
Old 12-15-2011, 02:32 PM
41Sqn_Banks 41Sqn_Banks is offline
Approved Member
 
Join Date: Oct 2007
Posts: 644
Default

Just a guess: gpPlayer() returns null if you are hosting it on a dedicated server and gpPlayer().Place() returns null if the player is not within an vehicle.

Code:
private void DoDamage()
{   // Script that triggered an accidental damage to the player plane
    // Author: FG28_Kodiak   Modified by: Salmo
    // Ref: http://forum.1cpublishing.eu/showthread.php?t=22184

    if(GamePlay.gpPlayer() != null && GamePlay.gpPlayer().Place() != null && GamePlay.gpPlayer().Place() is AiAircraft)
    {
        PlayerPlane = (AiAircraft)GamePlay.gpPlayer().Place();
        ...
    }
}
Reply With Quote