<RetVar/IF><RefObj> can sell ware <Var/Ware>

This forum serves as MSCI Reference at EGOSOFT. It's Read-Only for non MSCI Group members.

Moderators: Scripting / Modding Moderators, MSCI Moderators

Locked
User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24950
Joined: Sun, 2. Apr 06, 16:38
x4

<RetVar/IF><RefObj> can sell ware <Var/Ware>

Post by X2-Illuminatus » Fri, 8. Apr 11, 15:01

[skip|else] if [not]|while [not]|<RetVar/IF><RefObj> can sell ware <Var/Ware>


[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, it will return 1 on success and null on failure.
<RefObj> = The station you want to check, if it sells <Var/Ware>.
<Var/Ware> = The ware you want to check, if it is sold by <RefObj>.


Checks, if the as <Var/Ware> selected ware is sold by the as <RefObj> selected station. This will not check, if the station has that ware in its cargo space.


Example:

$target = get player tracking aim
if $target -> can sell ware $ware
|$amount = $target -> get amount of ware $ware in cargo bay
|if $amount > 0
||$price = $target -> get price of ware $ware
||write to player logbook: printf: fmt='You can buy %s %s to a price of %s per unit at %s.', $amount, $ware, $price, $target, null
|end
end
return null

Assuming $ware contains a ware and the current player $target is a station, this will check, if that station sells that ware. It will also check if the station has the ware in its cargo space. If that's the case, an appropriate message will be written to the player logbook.


Related Commands:

<RetVar/IF><RefObj> can buy ware <Var/Ware>


Command Location:

User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24950
Joined: Sun, 2. Apr 06, 16:38
x4

[TiP][49] 299524

Post by X2-Illuminatus » Mon, 9. May 11, 18:06

[skip|else] if [not]|while [not]|<RetVar/IF><RefObj> can sell ware <Var/Ware>


[skip|else] if [not]|while [not]| = Die möglichen bedingten Anweisungen, die mit diesem Befehl genutzt werden können.
<RetVar/IF> = Nutze eine Variable, wenn der Befehl eine Information zurückgeben soll. Wenn eine Variable genutzt wird, wird sie 1 im Erfolgs- und null im Fehlerfall enthalten.
<RefObj> = Die Station, die du darauf überprüfen möchtest, ob sie <Var/Ware> verkauft.
<Var/Ware> = Die Ware, von der du wissen möchtest, ob sie von <RefObj> verkauft wird.


Dieser Befehl überprüft, ob die als <Var/Ware> ausgewählte Ware von der als <RefObj> ausgewälten Station verkauft wird. Er wird nicht überprüfen, ob die Station die Ware wirklich im Lagerraum zu liegen hat.


Beispiel:

$target = get player tracking aim
if $target -> can sell ware $ware
|$amount = $target -> get amount of ware $ware in cargo bay
|if $amount > 0
||$price = $target -> get price of ware $ware
||write to player logbook: printf: fmt='Du kannst %s %s zu einem Preis von %s per Einheit an %s kaufen.', $amount, $ware, $price, $target, null
|end
end
return null

Vorausgesetzt $ware enthält eine Ware und das aktuelle Spielerziel $target ist eine Station, wird dies überprüfen, ob die Station diese Ware verkauft. Das Beispiel wird zudem überprüfen, ob die Ware im Lagerraum der Station liegt. Sollte dies der Fall sein, wird eine entsprechende Nachricht ins Spielerlogbuch geschrieben.


Verwandte Befehle:

<RetVar/IF><RefObj> can buy ware <Var/Ware>


Zu finden unter:

Locked

Return to “MSCI Reference”