[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/Race> = The race 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/Race> race. However, this will only check, if the rank of the <RefObj> to the <Var/Race> is high enough to buy the selected ware. It will neither check, if the <RefObj> has the right transport class nor if it has enough free cargo space nor if the selected ware is really offered by <Var/Race>.
Example:
$ware = 1 GJ shield
$race = Argon
$result = [PLAYERSHIP] -> can buy ware $ware from race $race
if $result == 1
|write to player logbook: printf: fmt='%s can buy ware %s offered by %s', [PLAYERSHIP], $ware, $race, null, null
else
|write to player logbook: printf: fmt='%s cannot buy ware %s offered by %s', [PLAYERSHIP], $ware, $race, null, null
end
return null
This will check if the [PLAYERSHIP] can buy 1 GJ shields from the Argon. It will write an appropriate message to the player logbook.
Related Commands:
<RetVar/IF><RefObj> can buy ware <Var/Ware> at station <Var/Station>
Command Location:
- »» Trade Commands
- »» for Ships
<RetVar/IF><RefObj> can buy ware <Var/Ware> from race <Var/Race>
- »» for Ships