<RetVar/IF><RefObj> uses ware <Var/Ware> as product

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

Moderators: Scripting / Modding Moderators, MSCI Moderators

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

<RetVar/IF><RefObj> uses ware <Var/Ware> as product

Post by X2-Illuminatus » Fri, 1. Apr 11, 17:17

[skip|else] if [not]|while [not]|<RetVar/IF><RefObj> uses ware <Var/Ware> as product


[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 in case of succes and 0 in case of failure.
<RefObj> = The station, which you want to check, if it sells the <Var/Ware>.
<Var/Ware> = The ware, which you want to check, if it's sold by the <RefObj>.


This will check, if the as <Var/Ware> selected ware is sold by the as <RefObj> selected station.


Example:

$ware = BoFu
$station = get player tracking aim
$result = $station -> uses ware $ware as product
if $result == 1
|write to player logbook: printf: fmt='%s is sold at %s', $ware, $station, null, null, null
else
|write to player logbook: printf: fmt='%s isn't sold at %s', $ware, $station, null, null, null
end
return null

This will check, if the ware BoFu is sold by the current player's target. An appropriate message will be written to the logbook.


Related Commands:

<RetVar/IF><RefObj> get products


Command Location:

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

[TiP][49] 299182

Post by X2-Illuminatus » Mon, 2. May 11, 19:10

[skip|else] if [not]|while [not]|<RetVar/IF><RefObj> uses ware <Var/Ware> as product


[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 0 im Fehlerfall enthalten.
<RefObj> = Die Station, von der du wissen möchtest, ob sie <Var/Ware> verkauft.
<Var/Ware> = Die Ware, von der du wissen möchtest, ob sie von <RefObj> verkauft wird.


Dies überprüft, ob die als <Var/Ware> ausgewählte Ware von der als <RefObj> ausgewählten Station verkauft wird.


Beispiel:

$ware = BoFu
$station = get player tracking aim
$result = $station -> uses ware $ware as product
if $result == 1
|write to player logbook: printf: fmt='%s wird von %s verkauft', $ware, $station, null, null, null
else
|write to player logbook: printf: fmt='%s wird von %s nicht verkauft', $ware, $station, null, null, null
end
return null

Dies überprüft, ob die Ware BoFu vom aktuellen Spielerziel verkauft wird. Eine entsprechende Nachricht wird ins Logbuch geschrieben.


Verwandte Befehle:

<RetVar/IF><RefObj> get products


Zu finden unter:

Return to “MSCI Reference”