[AL Plugin] Remove Prefix "Your" from Player Property
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
- Sandalpocalypse
- Posts: 4447
- Joined: Tue, 2. Dec 03, 22:28
-
- Posts: 25
- Joined: Wed, 18. Feb 04, 18:58
I tried to change the script to my needs, but i somehow don`t get it to work. Can anybody help me? (Probably something wrong with the "if $ship == Class/Object"-conditions.)
Code: Select all
001 $plugin.data = get global variable: name=$plugin.ID
002 if not $plugin.data
003 |$plugin.data = array alloc: size=2
004 |set global variable: name=$plugin.ID value=$plugin.data
005 |$plugin.data[0] = 0
006 |$plugin.data[1] = [TRUE]
007 end
008 if $plugin.event == 'init' OR $plugin.event == 'reinit'
009 |al engine: set plugin $plugin.ID description to 'Auto-Rename Player Property'
010 |$timer = 60
011 |al engine: set plugin $plugin.ID timer interval to $timer s
012 else if $plugin.event == 'isenabled'
013 |$retvar = $plugin.data[1]
014 |return $retvar
015 else if $plugin.event == 'start'
016 |$plugin.data[1] = [TRUE]
017 else if $plugin.event == 'stop'
018 |$plugin.data[1] = [FALSE]
019 else if $plugin.event == 'timer'
020 |if $plugin.data[1]
021 ||$ship.array = get ship array: of race Player class/type=Schiff
022 ||$n = size of array $ship.array
023 ||while $n
024 |||dec $n =
025 |||$ship = $ship.array[$n]
026 |||$name = $ship -> get name
027 |||$sub = get substring of $name offset=0 length=3
028 |||if $sub == 'Ihr'
029 ||||$sub1 = get substring of $name offset=4 length=99
030 ||||if $ship == TL
031 |||||$newname = 'TL' + ' ' + $sub1
032 |||||$ship -> set name to $newname
033 ||||else if $ship == M1
034 |||||$newname = 'M1' + ' ' + $sub1
035 |||||$ship -> set name to $newname
036 ||||else if $ship == M2
037 |||||$newname = 'M2' + ' ' + $sub1
038 |||||$ship -> set name to $newname
039 ||||else if $ship == M3
040 |||||$newname = 'M3' + ' ' + $sub1
041 |||||$ship -> set name to $newname
042 ||||else if $ship == M4
043 |||||$newname = 'M4' + ' ' + $sub1
044 |||||$ship -> set name to $newname
045 ||||else if $ship == M5
046 |||||$newname = 'M5' + ' ' + $sub1
047 |||||$ship -> set name to $newname
048 ||||else if $ship == M6
049 |||||$newname = 'M6' + ' ' + $sub1
050 |||||$ship -> set name to $newname
051 ||||else if $ship == M7
052 |||||$newname = 'M7' + ' ' + $sub1
053 |||||$ship -> set name to $newname
054 ||||else if $ship == M8
055 |||||$newname = 'M8' + ' ' + $sub1
056 |||||$ship -> set name to $newname
057 ||||else if $ship == TS
058 |||||$newname = 'TS' + ' ' + $sub1
059 |||||$ship -> set name to $newname
060 ||||else if $ship == TP
061 |||||$newname = 'TP' + ' ' + $sub1
062 |||||$ship -> set name to $newname
063 ||||else if $ship == TM
064 |||||$newname = 'TM' + ' ' + $sub1
065 |||||$ship -> set name to $newname
066 ||||else if $ship == Schiff
067 |||||$newname = $sub1
068 |||||$ship -> set name to $newname
069 ||||end
070 |||end
071 ||end
072 ||$station.array = get station array: of race Player class/type=Station
073 ||$n = size of array $station.array
074 ||while $n
075 |||dec $n =
076 |||$station = $station.array[$n]
077 |||$name = $station -> get name
078 |||$sub = get substring of $name offset=0 length=3
079 |||if $sub == 'Ihr'
080 ||||$sub1 = get substring of $name offset=4 length=99
081 ||||$station -> set name to $sub1
082 |||end
083 ||end
084 |end
085 end
086 return null
- Serial Kicked
- Posts: 3823
- Joined: Fri, 12. Aug 05, 20:46
after
025 |||$ship = $ship.array[$n]
add:
$ship.class = $ship -> get object class
then replace your faulty tests like:
if $ship = TL
by
if $ship.class = TL
025 |||$ship = $ship.array[$n]
add:
$ship.class = $ship -> get object class
then replace your faulty tests like:
if $ship = TL
by
if $ship.class = TL
X3:TC/AP Pirate Guild 3 - Yaki Armada 2 - Anarkis Defense System
Anarkis Gaming HQ
Independent Game Development
X3 Scripting and Modding Station
Anarkis Gaming HQ
Independent Game Development
X3 Scripting and Modding Station
Could you make it so it Automaticly puts something else in front.. I want it to say GRI(My Company in X3, Short for Genuru Research Incorporation) instead of Your
EDIT
Noticed someone made this on the first page.. Any1 have that file? The links are broken
Yet another edit
Albion Prelude compatible?
EDIT
Noticed someone made this on the first page.. Any1 have that file? The links are broken
Yet another edit
Albion Prelude compatible?
F signature
According to this threadPeanutcat wrote:Albion Prelude compatible?
http://forum.egosoft.de/viewtopic.php?t=315630&start=0
yes.
(Sorry for the necro, but I think it's best if the last post in the thread is positive).