I found this on the vault.Cant get it to work for some reason. It is a save character widget. The tag is the same as script.
void i_save_char(){ // The object that activated the item object oActivator = GetItemActivator();
// The object that oActivator aimed the item at object oTarget = GetItemActivatedTarget();
// Only worry about saving players if(TRUE == GetIsPC(oTarget)) { // Do the save ExportSingleCharacter(oTarget);
// Notify the players that the save has taken place if(oTarget == oActivator) { SendMessageToPC(oActivator, "Your player file has been saved."); } else { SendMessageToPC(oActivator, GetName(oTarget) + "'s player file has been saved."); SendMessageToPC(oTarget, GetName(oActivator) + " has forced a save of your player file."); } }
// Sass them just a bit if they do something silly else { SendMessageToPC(oActivator, "Somehow I don't think " + GetName(oTarget) + " has a player file since ohhhhh... they are not a PLAYER."); }} // END ofvoid main()
Save character widget .
Débuté par
Knight_Shield
, mai 04 2011 01:27
#1
Posté 04 mai 2011 - 01:27
#2
Posté 04 mai 2011 - 02:57
Well, for one, your code is completely commented out... I'll assume it's a formatting issue:
This script is essentially overwritting the character file that you are currently using, rather than making a new entry. That is what you want, yes?
EDIT: I made some minor adjustments, but it still works.
void main()
{
// The object that activated the item
object oActivator = GetItemActivator();
// The object that oActivator aimed the item at
object oTarget = GetItemActivatedTarget();
// Only worry about saving players
if(FALSE == !GetIsPC(oTarget))
{
// Do the save
if(oTarget == oActivator)
{
ExportSingleCharacter(oActivator);
SendMessageToPC(oActivator, "Your player file has been saved.");
}
else
{
SendMessageToPC(oActivator, GetName(oTarget) + "'s player file has been saved.");
SendMessageToPC(oTarget, GetName(oActivator) + " has forced a save of your player file.");
}
}
// Sass them just a bit if they do something silly
else
{
SendMessageToPC(oActivator, "Somehow I don't think " + GetName(oTarget) + " has a player file since ohhhhh... they are not a PLAYER.");
}
} // END ofvoid main()
This script is essentially overwritting the character file that you are currently using, rather than making a new entry. That is what you want, yes?
EDIT: I made some minor adjustments, but it still works.
Modifié par Evelath, 04 mai 2011 - 02:58 .
#3
Posté 04 mai 2011 - 03:12
Thanks Evelath





Retour en haut







