There are several ways to go about this and some of it depends on what you are doing in your mod.
Here's one version you could do so long as your are not allowing players to have anything other than the default player appearances. It keeps polymorphed characters from being saved to prevent a bug. You would implement it into your OnModuleLoad script:
//Put this on the top of our OnModuleLoad script or make it a separate include.
const float DELAY = 120.0f; //2 minutes
void ExportAllPlayers()
{
object oPC = GetFirstPC();
while ( GetIsObjectValid(oPC))
{
if(GetAppearanceType(oPC) > 6)
{
SendMessageToPC(oPC, "Your character can not be saved while polymorphed");
}
else
{
ExportSingleCharacter(oPC);
SendMessageToPC(oPC, "Your character has been saved");
}
oPC = GetNextPC();
}
DelayCommand(DELAY, ExportAllPlayers());
}
//OnModuleLoad example...
void main()
{
//stuff
//more stuff
//lots of other stuff
DelayCommand(120.0, ExportAllPlayers());//Add this line to your OnModuleLoad script
}
Hope it helps. Good luck.
Modifié par GhostOfGod, 15 avril 2011 - 07:51 .