Difference between revisions of "GetIsID"

180 bytes removed ,  17:16, 9 September 2010
correcting
imported>Hammil
(Added "GetIsID Player" workaround)
imported>DragoonWraith
(correcting)
 
Line 6: Line 6:
'''Example:'''
'''Example:'''
   Begin Onequip Player              ; One script for a whole set of armor
   Begin Onequip Player              ; One script for a whole set of armor
     if GetIsID mycuirass == 1
     if GetIsID mycuirass
       message "Cuirass equipped"
       message "Cuirass equipped"
     elseif GetIsID myboots == 1
     elseif GetIsID myboots
       message "Boots equipped"
       message "Boots equipped"
     elseif GetIsID mygauntlets == 1
     elseif GetIsID mygauntlets
       message "Gauntlets equipped"
       message "Gauntlets equipped"
     elseif GetIsID mygreaves == 1
     elseif GetIsID mygreaves
       message "Greaves equipped"     
       message "Greaves equipped"     
     elseif GetIsID myhelmet == 1
     elseif GetIsID myhelmet
       message "Helmet equipped"
       message "Helmet equipped"
     else
     else
Line 21: Line 21:
   end
   end


You can also use it to check the target ID for Script Effects, but this '''does not''' work for the player. The following will not work:
== Note ==
  if GetIsID player == 1
* The script compiler assumes that <tt>player</tt> actually refers to <tt>playerRef</tt>. Therefore, <tt>GetIsID player</tt> will never return true. Use <tt>GetIsReference player</tt> instead.
    message "Script Effect is on Player"
  endif
Use the following instead:
  ref self
  set self to GetSelf
  if (self.GetIsReference player == 1)
    message "Script Effect is on Player"
  endif


[[Category: Functions]]
[[Category: Functions]]