Well this is what we used. It is for a PW where you can open locks or disarm traps that both respawn. But it works to where you can only do it once per lock/trap per server reset.
For traps:
void main()
{
object oPC = GetLastDisarmed();
string sPC = "T" + GetName(oPC);
if (!GetLocalInt(OBJECT_SELF, sPC))
{
int iDC = GetTrapDisarmDC(OBJECT_SELF);
int iXP = iDC * 10;
GiveXPToCreature(oPC, iXP);
SetLocalInt(OBJECT_SELF, sPC, 1);
}
}
And locks:
void main()
{
object oPC = GetLastUnlocked();
string sPC = "L" + GetName(oPC);
if (!GetLocalInt(OBJECT_SELF, sPC))
{
int iDC = GetLockUnlockDC(OBJECT_SELF);
int iXP = iDC * 10;
GiveXPToCreature(oPC, iXP);
SetLocalInt(OBJECT_SELF, sPC, 1);
}
}
Modifié par GhostOfGod, 25 février 2012 - 10:19 .