<RetVar/IF><RefObj> can transport <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 transport <Var/Ware>

Post by X2-Illuminatus » Wed, 30. Mar 11, 12:50

[skip|else] if [not]|while [not]|<RetVar/IF><RefObj> can transport <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, the command will return 1 on success and null on failure.
<RefObj> = The ship that should transport the <Var/Ware>.
<Var/Ware> = The ware that should be transported by the <RefObj>.


This command will check if the as <RefObj> selected ship can transport the as <Var/Ware> selected ware. However, it will only check if the <RefObj> has the correct transport class, not if it has enough free cargo space.


Example:

$ware = 5 MJ shield
$result = [PLAYERSHIP] -> can transport ware $ware
if $result == 1
|write to player logbook: printf: fmt='%s has the right transport class to transport %s', [PLAYERSHIP], $ware, null, null, null
else
|write to player logbook: printf: fmt='%s hasn't the right transport class to transport %s', [PLAYERSHIP], $ware, null, null, null
end
return null


This will check, if the [PLAYERSHIP] has the right transport class to transport the ware 5 MJ shield. An appropriate message will be written to the player logbook.


Command Location:

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

[TiP][49] 299092

Post by X2-Illuminatus » Mon, 2. May 11, 18:14

[skip|else] if [not]|while [not]|<RetVar/IF><RefObj> can transport <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> = Das Schiff, das die <Var/Ware> transportieren soll.
<Var/Ware> = Die Ware, die vom <RefObj> transportiert werden soll.


Dieser Befehl überprüft, ob das als <RefObj> ausgewählte Schiff die als <Var/Ware> ausgewählte Ware transportieren kann. Er wird jedoch nur überprüfen, ob das <RefObj> die richtige Transportklasse, nicht ob es genügend freien Frachtraum hat.


Beispiel:

$ware = 5 MJ Schild
$result = [PLAYERSHIP] -> can transport ware $ware
if $result == 1
|write to player logbook: printf: fmt='%s hat die richtige Transportklasse, um %s zu transportieren', [PLAYERSHIP], $ware, null, null, null
else
|write to player logbook: printf: fmt='%s hat nicht die richtige Transportklasse, um %s zu transportieren', [PLAYERSHIP], $ware, null, null, null
end
return null


Dies wird überprüfen, ob das Spielerschiff [PLAYERSHIP] die richtige Transportklasse hat, um die Ware 5 MJ Schilde zu transportieren. Eine entsprechende Nachricht wird ins Logbuch geschrieben.


Zu finden unter:

Locked

Return to “MSCI Reference”