[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 that should buy the <Var/Ware>.
<Var/Ware> = The ware the <RefObj> should buy.
<Var/Station> = The station that offers the <Var/Ware>.
This checks if the as <RefObj> selected ship can buy the as <Var/Ware> selected ware offered by the as <Var/Station> selected station. The command will check, if the ware is offered by the selected station and if the rank of the <RefObj> to the owner race of <Var/Station> is high enough to buy that ware. It won't check, if the <RefObj> has the right cargo class, if enough free cargo space is available, if it can dock at the station and if the station has the ware actually in stock.
$result = [PLAYERSHIP] -> can buy ware $ware at station $station
if $result == 1
|write to player logbook: printf: fmt='%s can buy ware %s offered at %s', [PLAYERSHIP], $ware, $station, null, null
|write to player logbook: printf: fmt='%s cannot buy ware %s offered at %s', [PLAYERSHIP], $ware, $station, null, null
Assuming $ware contains a ware offered at $station, this will check if the [PLAYERSHIP] can buy that ware. An appropriate message will be written to the player logbook.
<RetVar/IF><RefObj> can buy ware <Var/Ware> from race <Var/Race>
- »» Trade Commands
- »» for Ships
<RetVar/IF><RefObj> can buy ware <Var/Ware> at station <Var/Station>
- »» for Ships