HorseGetOwner

From NWN Lexicon
Jump to: navigation, search


HorseGetOwner(object)

Retrieves the owner of a horse.

Parameters

oHorse

The object whose owner is required.


Description

This function will return the owner of the target if it is a valid horse.

If there is no owner, or the target is not a valid horse, it will return OBJECT_INVALID.



Remarks

Note that this cannot be used when a rider is mounted, because the horse object doesn't exist at that time.


Requirements

#include " x3_inc_horse "

Version

1.69

Example

// A PC mounts a horse provided it has no owner.
#include "x3_inc_horse"
 
 
void main()
{
  object oPC    = GetPCSpeaker();
  object oHorse = GetObjectByTag("enter tag here");
 
  if(!GetIsObjectValid(HorseGetOwner(oHorse)))
  {
    AssignCommand(oPC, HorseMount(oHorse));
  }
}

See Also

functions: 

HorseGetPaladinMount



author: Proleric, editor: Mistress