Home   Help Search Login Register  

Author Topic: Find out whether unit is human or AI  (Read 1615 times)

0 Members and 1 Guest are viewing this topic.

Offline Kronzky

  • Members
  • *
    • My OFP/VBS Scripts/Missions/Addons
Find out whether unit is human or AI
« on: 07 Oct 2002, 23:28:14 »
Is there a way to determine within a script whether a particular unit is a human player or AI?

sussmori

  • Guest
Re:Find out whether unit is human or AI
« Reply #1 on: 08 Oct 2002, 03:29:11 »
One way to do it is by creating an array with the names of all players. Each player's machine can add the name of its 'player' to a publicVariable array.

Then it's just a matter of seeing if a unit's name is in the array or not

Offline Black_Feather

  • Former Staff
  • ****
  • I'll never forget you Daisey.
Re:Find out whether unit is human or AI
« Reply #2 on: 08 Oct 2002, 04:23:05 »
I think you can use this too

?unitname == player : dosomething

Offline Kronzky

  • Members
  • *
    • My OFP/VBS Scripts/Missions/Addons
Re:Find out whether unit is human or AI
« Reply #3 on: 08 Oct 2002, 06:26:35 »
The ?unitname == player : dosomething did the trick! And so elegantly...

Thanks a bunch!