Just use an undropable item, I call mine database. Then just use the get item posssessed by, and write the variable to the database. For instance:
object oDatabase = GetItemPossessedBy(oPC, "database");
//checks to see if the player has the object.
SetLocalInt(oDatabase,"NaggingWound", GetLocalInt(oDatabase,"NaggingWound")+1);
//example of how to increment a local variable on the database object
if (!GetIsObjectValid(oDatabase))
{
// Now create the database on the PC
CreateItemOnObject("database", oPC, 1);
//example of part of onclient enter which creates the database object on the player if they don't have one.
if (GetLocalInt(oDatabase, "Expired") == 1)
{
DelayCommand (12.0,(ApplyEffectToObject (DURATION_TYPE_INSTANT, eDeath, oPC, 1.0f)));
DelayCommand (14.0,SendMessageToPC(oPC, " STILL DEAD! "));
DelayCommand (100.0, SetLocalInt (oDatabase, "Expired", 0));
}
//example of how to check the database for a specific int set to specific number.
if (GetLocalInt(oDatabase,"NaggingWound") > 10)
//example of checking for an incrmented int if higher than a certain number.
DeleteLocalInt(oDatabase,"MountI");
//example of deleting a local int
SetLocalInt(oDatabase,"MountI", 1);
//example of setting a local int
Modifié par ffbj, 12 mai 2011 - 12:33 .