generated from Jaysyn/ModuleTemplate
23 lines
494 B
Plaintext
23 lines
494 B
Plaintext
void main()
|
|
{
|
|
int i = 1;
|
|
// * find first free chair
|
|
object oChair = GetNearestObjectByTag("Couch1", OBJECT_SELF,i);
|
|
int bFoundChair = FALSE;
|
|
while (bFoundChair == FALSE && GetIsObjectValid(oChair) == TRUE)
|
|
{
|
|
// * This chair is free
|
|
if (GetIsObjectValid(GetSittingCreature(oChair)) == FALSE)
|
|
{
|
|
bFoundChair = TRUE;
|
|
ActionSit(oChair);
|
|
}
|
|
else
|
|
{
|
|
i++;
|
|
oChair = GetNearestObjectByTag("Couch1", OBJECT_SELF,i);
|
|
}
|
|
}
|
|
}
|
|
|