Home   Help Search Login Register  

Author Topic: <NULL-object>  (Read 586 times)

0 Members and 1 Guest are viewing this topic.

Uldics

  • Guest
<NULL-object>
« on: 19 May 2004, 08:27:51 »
I have this script, where I want the text to bee shown only one time when somebody gets in or out. For some reasons I don't want to use eventhandlers, just this script. The problem is, that it's working fine with Weas or East, but, when there is no driver, then it shows the message every second, not just the first time. It looks like when thereis no driver, it shows that driver is some <NULL-object> , which gives allways false when in if...then condition. How could I get the true from it, so my script works?

_car = _this select 0

#begin
_player = driver _car
_side = side _player

hint format ["Driver = %1", _player]

? getdammage _car != 0 : _car setdammage 0
? (_player == _olddriver) : goto "scoring"
goto format ["%1", side _player]
~2
goto "begin"

#West
titletext ["NATO forces capture Policejeep", "PLAIN"]
goto "startscoring"


#East
titletext ["Russian forces capture Policejeep", "PLAIN"]
goto "startscoring"

#UNKNOWN
? _olddriver != _player : titletext ["Policejeep just became empty!", "PLAIN"]
_olddriver = _player
~1
goto "begin"

#startscoring
_player addscore 10
_olddriver = _player
_count = 0


#scoring
~1
_count = _count + 1
?(_count == 30): goto "score"
goto "begin"


#score
?(_side == West): WestScore = WestScore + 2
?(_side == East): EastScore = EastScore + 2
PublicVariable "WestScore"
PublicVariable "EastScore"
_count = 0
goto "begin"

Exit




Unnamed

  • Guest
Re:<NULL-object>
« Reply #1 on: 19 May 2004, 12:01:19 »
Hi,

Use IsNull

Code: [Select]
~1

? IsNull _Player : goto "begin"

hint format ["Driver = %1", _player]

Uldics

  • Guest
Re:<NULL-object>
« Reply #2 on: 19 May 2004, 17:16:19 »
Thanks, it works now!