HorseGetOwner
From NWN Lexicon
Contents |
[edit] HorseGetOwner(object)
Retrieves the owner of a horse.
object HorseGetOwner( object oHorse );
[edit] Parameters
oHorse
The object whose owner is required.
[edit] 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.
[edit] Remarks
Note that this cannot be used when a rider is mounted, because the horse object doesn't exist at that time.
[edit] Requirements
#include " x3_inc_horse "
[edit] Version
1.69
[edit] 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)); } }
[edit] See Also
functions: |
author: Proleric, editor: Mistress