<RetVar/IF><RefObj> only player own ships can trade with

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: 24967
Joined: Sun, 2. Apr 06, 16:38
x4

<RetVar/IF><RefObj> only player own ships can trade with

Post by X2-Illuminatus » Sat, 2. Apr 11, 19:20

[skip|else] if [not]|while [not]|<RetVar/IF><RefObj> only player own ships can trade with


[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 contain 1 on success and null on failure.
<RefObj> = The station you want to know, if only player own ship can trade with.

This command checks, if only player own ships can trade with the as <RefObj> selected station. If this is the case, it will return 1 else null.
Only player own stations can be adjusted to only trade with player owned ships.


Example:

$trade.station.arr = array alloc: size=0
$station.arr = get station array: of race Player class/type=null
$size = size of array $station.arr
while $size
|dec $size =
|$station = $station.arr[$size]
|if $station -> only player own ships can trade with
||append $station to array $trade.station.arr
|end
end
return null

This will get all player own stations that only trade with player own ships in the array $trade.station.arr.


Command Location:

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

[TiP][49] 299244

Post by X2-Illuminatus » Tue, 3. May 11, 18:58

[skip|else] if [not]|while [not]|<RetVar/IF><RefObj> only player own ships can trade with


[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, von der du wissen möchtest, ob nur spielereigene Schiffe mit ihr handeln können.


Dieser Befehl überprüft, ob nur spielereigene Schiffe mit der als <RefObj> ausgewählten Station handeln können. Wenn dies der Fall ist, wird 1 sonst null zurückgegeben.
Nur spielereigene Stationen kann man so einstellen, dass sie nur mit spielereigenen Schiffen handeln.


Beispiel:

$trade.station.arr = array alloc: size=0
$station.arr = get station array: of race Player class/type=null
$size = size of array $station.arr
while $size
|dec $size =
|$station = $station.arr[$size]
|if $station -> only player own ships can trade with
||append $station to array $trade.station.arr
|end
end
return null

Dies erfässt alle spielereigenen Stationen, die nur mit spielereigenen Schiffen handeln, und schreibt sie in das Array $trade.station.arr.


Zu finden unter:

Return to “MSCI Reference”