GetSittingCreature(object)

Determines which creature sitting on a particular object.

object GetSittingCreature(
    object oChair
);

Parameters

oChair

The object to check who is sitting on.


Description

Returns the creature that is currently sitting on the oChair

Returns OBJECT_INVALID if oChair is not a valid placeable or no creature is sitting on oChair.



Version

1.61

Example

//Make everybody stop sitting in chairs tagged "SITTING_CHAIR"
void main()
{
int nCount=0;

object oSitter;

object oChair=GetObjectByTag("SITTING_CHAIR", nCount);

while (GetIsObjectValid(oChair))
   {
   oSitter=GetSittingCreature(oChair);
   if (GetIsObjectValid(oSitter))
         AssignCommand(oSitter, ClearAllActions());

   nCount++;
   oChair=GetObjectByTag("SITTING_CHAIR", nCount);
   }
}

See Also

functions: ActionSit
categories: Get Data from Object Functions


 author: Tom Cassiotis, editor: Lilac Soul