Basic structure for you (hastily written in notepad, so I may have made a typo or two along the way).
void CountDown(float fTime, object oPC)
{
FloatingTextStringOnCreature(FloatToString(fTime), oPC);
// Is countdown complete?
if(fTime <= 0.0f)
{
if( /* puzzle completed */ )
{ // do something
}
else
{ // do something else
}
}
// Otherwise continue countdown
else
{ fTime -= 1.0f;
DelayCommand(1.0f, CountDown(fTime, oPC));
}
}
void main()
{
object oPC = GetEnteringObject();
if(!GetIsPC(oPC)) return;
CountDown(120.0f, oPC);
}
Modifié par _six, 24 juillet 2011 - 01:52 .