HorseGetHorse(object, int)

Retrieves the horses owned by a creature.

object HorseGetHorse(
    object oRider,
    int nN = 1
);

Parameters

oRider

The object that might own horses.

nN

The Nth horse owned may be requested. (Default: 1)


Description

This function will return the Nth horse owned by the target.



Remarks

Returns OBJECT_INVALID if fewer than nN horses are owned.

If the target is mounted, the horse they are riding doesn't count, because it doesn't exist as a horse object. The function will only return the owner's dismounted horses.


Requirements

#include "x3_inc_horse"

Version

1.69

Example

// This example actions the PC to mount the first horse which they own.
#include "x3_inc_horse"


void main()
{
  object oPC = GetEnteringObject();

  object oHorse = HorseGetHorse(oPC);

  if(GetIsObjectValid(oHorse))
  { 
    AssignCommand(oPC, HorseMount(oHorse));
  }  
}

See Also

functions:  HorseGetMyHorse | HorseGetPaladinMount | HorseGetOwner
categories:  Horse Functions


author: Proleric, editor: Mistress