27 lines
724 B
Plaintext
27 lines
724 B
Plaintext
// prison_ox
|
|
void main()
|
|
{
|
|
object oWP=GetWaypointByTag("POST_PRISONERS");
|
|
object oPC=GetExitingObject();
|
|
object oOb=GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR,PLAYER_CHAR_IS_PC,oWP,1);
|
|
int nN=1;
|
|
if (oOb!=oPC&&GetIsObjectValid(oOb))
|
|
{ // PC detected
|
|
if (GetIsPC(oOb)&&GetArea(oOb)==GetArea(oWP))
|
|
{ // pcs
|
|
// do nothing
|
|
} // pcs
|
|
else
|
|
{ // cleanup prisoners
|
|
oOb=GetNearestObjectByTag("PRISONERS",oWP,nN);
|
|
while(GetIsObjectValid(oOb))
|
|
{ // remove prisoners
|
|
DelayCommand(1.0,DestroyObject(oOb));
|
|
nN++;
|
|
oOb=GetNearestObjectByTag("PRISONERS",oWP,nN);
|
|
} // remove prisoners
|
|
} // cleanup prisoners
|
|
} // PC detected
|
|
|
|
}
|