OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: CopyrightPhilly on 09 Aug 2004, 04:27:07

Title: Detect Player name
Post by: CopyrightPhilly on 09 Aug 2004, 04:27:07
hi

dose anyone know how to detect a players name so say if the players name is ODB_CopyrightPhilly then to goto "rename"

cheers, Philly
Title: Re:Detect Player name
Post by: Mud_Spike on 09 Aug 2004, 08:56:39
You mean  "DELTA four black (Lundstrom)" ? (or something)

You could play around with format.
I.e.,
Code: [Select]
_badname = "DELTA four BLACK (Lundstrom)"
_thisone = format ["%1", playerUnit]
if (_badname == _thisone) then { dostuff }

Of course, it wouldnt be much use for anyone playing the missing and not being named Lundstrom.


Title: Re:Detect Player name
Post by: macguba on 09 Aug 2004, 10:29:55
Try

? name player == "whatever" : goto "rename"

If it doesn't work play with the syntax a little.
Title: Re:Detect Player name
Post by: CopyrightPhilly on 09 Aug 2004, 17:27:53
Thanks for the replys guys

yea macguba thats what i ended up with, i was trying to do it with out the "" round the name so thats why i could find it out...

cheers, Philly