Vorweg mal die Quellen:
Das Init-Script
Code: Select all
001 load text: id=99
002 set script command upgrade: command=COMMAND_TYPE_STATION_30 upgrade=[TRUE]
003 set script command upgrade: command=COMMAND_TYPE_SPECIAL_31 upgrade=[TRUE]
004 global script map: set: key=COMMAND_TYPE_STATION_30, class=Station, race=Player, script='stprofit.cmd', prio=0
005 global script map: set: key=COMMAND_TYPE_SPECIAL_31, class=Ship, race=Player, script='stprofit.cmd.prot', prio=0
006 $dummy = array alloc: size=0
007 set global variable: name='gstp' value=$dummy
008 return null
Code: Select all
001 skip if $Limit >= 0
002 $Limit = 0
003 $gtpa = get global variable: name='gstp'
004 $stname = [THIS] -> get name
005 append $stname to array $gtpa
006 append 0 to array $gtpa
007 $index = size of array $gtpa
008 $index = $index - 1
009 while [TRUE]
010 $money = [THIS] -> get money
011 write to player logbook $index
012 if $money > $Limit
013 $money = $money - $Limit
014 $gtpa = get global variable: name='gstp'
015 $curmon = $gtpa[$index]
016 $curmon = $curmon + $money
017 $gtpa[$index] = $curmon
018 $playermoney = get player money
019 if $playermoney + $money > 0
020 add money to player: $money
021 end
022 $money = - $money
023 [THIS] -> add money: $money
024 end
025 @ = wait randomly from 60000 to 65000 ms
026 end
027 return null
Code: Select all
001 $gtpa = get global variable: name='gstp'
002 $max = size of array $gtpa
003 $c = 0
004 $str = ' '
005 $crlf = read text: page=9999 id=1
006 while $c < $max
007 $money = $gtpa[$c]
008 inc $c =
009 $cstation = $gtpa[$c]
010 $out = read text: page=9999 id=100
011 $out = sprintf: pageid=9999 textid=100, $cstation, $money, null, null, null
012 $str = $str + $crlf + $out
013 inc $c =
014 end
015 $out = read text: page=9999 id=101
016 $str = $str + $crlf + $out
017 write to player logbook $str
018 return null
1. Ich kann tun und lassen was ich will. Im Protokollscript krieg ich nur Null und 0 raus. Irgendwie wird das nicht im globalen Array gespeichert. Wo liegt das Problem ?
2. Wenn ich das Stations-Script auf einer Station starte, erscheint in dem Slot nix, was muß ich da tun ?
Danke schonmal