View Single Post
  #156  
Old 05-24-2011, 11:08 AM
Iku_es Iku_es is offline
Approved Member
 
Join Date: May 2011
Location: Bilbao, Spain
Posts: 30
Default

Hi,

I have never tried scripting for Clod, but as a C# programer, I'm going to make an educated guess:

Try changing this line:

if (aircraft.Name() == GamePlay.gpPlayer().Place().Name() )

for this one:

if ( aircraft.Name().Equals(GamePlay.gpPlayer().Place().Name()) )

I'm not sure of this because I don't know the types of the objects involved in the comparison (strings?), but try it anyway.

(Check this for more info about why: C# Value Type vs Reference Type)

Also you should check that aircraft is not null, and that GamePlay.gpPlayer().Place() is not null, for security reasons in order to avoid NullReference exceptions.

Last edited by Iku_es; 05-24-2011 at 01:18 PM.
Reply With Quote