[skip|else] if [not]|while [not]| = The possible 'Conditional' statements that can be used with this command.
<RetVar/IF> = Use a variable, if the command should return information. If a variable is used, the command will return 1 on success and 0 on failure.
<RefObj> = The ship, which you want to check, if it's able to transport the selected <Var/Passenger>.
<Var/Passenger> = The passenger you want to transport with the <RefObj>.
This command will check if the selected <Var/Passenger> can be transported by the ship selected as <RefObj>. Therefore it will check if the <RefObj> has at least transport class M, an installed Cargo Life support system and at least 6 (for VIPs 8) units of free cargo space.
Example:
$ship = get player tracking aim
$passenger.arr = $ship -> get passenger array
$size.passenger.arr = size of array $passenger.arr
while $size.passenger.arr
|$Passenger = $passenger.arr[0]
|$transport = [PLAYERSHIP] -> can transport passenger: $Passenger
|if $transport == 1
||write to player logbook: printf: fmt='%s can transport passenger %s', [PLAYERSHIP], $Passenger, null, null, null
|else
||write to player logbook: printf: fmt='%s cannot transport passenger %s', [PLAYERSHIP], $Passenger, null, null, null
|end
|dec $size.passenger.arr =
end
return null
This will get the player's currently selected target. Then it gets all passengers onboard the selected ship and checks if the [PLAYERSHIP] can transport one of the passengers. In case of success or failure an appropriate message will be written into the player's logbook.
Command Location:
- »» Trade Commands
- »» Passengers
<RetVar/IF><RefObj> can transport passenger:=<Var/Passenger>
- »» Passengers