Scripting:Flotten benennen
Aus STNE-Wiki
(Unterschied zwischen Versionen)
Xenon (Diskussion | Beiträge) K (→Skriptcode) |
Death (Diskussion | Beiträge) (→Skriptcode) |
||
Zeile 12: | Zeile 12: | ||
'name4' | 'name4' | ||
} | } | ||
- | i=0 | + | VAR i AS integer = 0 |
VAR Flotte AS new CMyFlotte( idDerFlotte ); | VAR Flotte AS new CMyFlotte( idDerFlotte ); | ||
- | VAR | + | VAR Ship as CMyShip |
- | + | FOR ( EACH Ship IN Flotte.Ships ) | |
- | + | ||
{ | { | ||
- | |||
Ship.Name = <nowiki>''</nowiki> & names[i] | Ship.Name = <nowiki>''</nowiki> & names[i] | ||
- | i=i+1 | + | i = i + 1 |
} | } | ||
Version vom 4. September 2006, 12:39 Uhr
fertige Scripte | Anleitungen und FAQ | Überblick über die Scripting-Sektion | Hilfen zum Arbeiten im Wiki |
Flotten-Benennung
Skriptcode
VAR i AS integer VAR names[] AS String = { 'name1', 'name2', 'name3', 'name4' } VAR i AS integer = 0 VAR Flotte AS new CMyFlotte( idDerFlotte ); VAR Ship as CMyShip FOR ( EACH Ship IN Flotte.Ships ) { Ship.Name = '' & names[i] i = i + 1 }