Could anyone point me in the right direction as to what might becausing this? I thought I had found something in the enterMod script, but I guess that wasn't it.
Thanks
Modifié par ShaDoOoW, 04 octobre 2011 - 11:24 .
No idea what that means. I started a blank module about 2 years ago, installed CEP and also brought in some scripts from the mod I used to play on. But I couldn't tell you which."What system are you using?"
#include "leo_regen"
#include "inc_quest"
void main()
{
ExecuteScript("zep_cr_nocheat", OBJECT_SELF);
ExecuteScript("leo_regen_enter",OBJECT_SELF);
object oPC = GetEnteringObject();
SetLocalString(oPC, "ID", GetPCPlayerName(oPC) );
SetLocalString(oPC, "NAME", GetName(oPC) );
SetLocalString(oPC, "KEY", GetPCPublicCDKey(oPC) );
SetLocalString(oPC, "IP", GetPCIPAddress(oPC) );
/* Informational messages */
DelayCommand(10.0, SendMessageToPC(oPC, "It is VERY important that you read the Journal Entries, as the server rules are stated in it. It will be your responsibiltiy to know the server rules. "));
/* Insert persistent journal entries */
DelayCommand( 2.0, enableQuestJournal(oPC));
if( GetIsPC(oPC) && !GetIsDM(oPC) )
{
string sReport;
sReport = ">>> ID: " + GetPCPlayerName(oPC)
+ "; Name: "+ GetName(oPC)
+ "; CD Key:" + GetPCPublicCDKey(oPC)
+ "; IP:" + GetPCIPAddress(oPC)
+ "; has logged in.";
WriteTimestampedLogEntry(sReport);
SendMessageToAllDMs(sReport);
}
string sHPVar = "hp" + GetName(oPC);
string sDeadVar = "dd" + GetName(oPC);
int nHPOnExit = GetLocalInt(OBJECT_SELF, sHPVar);
int nDead = GetLocalInt(OBJECT_SELF, sDeadVar);
int nMaxHP = GetMaxHitPoints(oPC);
if ( nDead == 1 )
{
CreateItemOnObject("death", oPC, 1);
SetLocalInt(OBJECT_SELF, sDeadVar, 0);
}
effect eDeath = EffectDeath();
if( GetItemPossessedBy(oPC, "death") != OBJECT_INVALID )
{
ApplyEffectToObject(DURATION_TYPE_INSTANT, SupernaturalEffect(eDeath), oPC);
}
/* Returning characters */
if ( nHPOnExit > 0
|| nDead )
{
if ( !GetIsDM(oPC) )
{
/* Reset previous hp */
effect dmg = EffectDamage(nMaxHP - nHPOnExit);
ActionWait(0.1);
ApplyEffectToObject(DURATION_TYPE_INSTANT, dmg, oPC);
}
}
/* Initial login */
else
{
if ( !GetIsDM(oPC) )
{
/* Check for undesired talents */
ExecuteScript("mod_talentcheck", oPC);
}
}
}
Modifié par Zeidae, 05 octobre 2011 - 05:11 .
So I removed the effect part. We'll see what happens./* Reset previous hp */
effect dmg = EffectDamage(nMaxHP - nHPOnExit);
ActionWait(0.1);
ApplyEffectToObject(DURATION_TYPE_INSTANT, dmg, oPC);
Modifié par ffbj, 06 octobre 2011 - 01:34 .
ShaDoOoW wrote...
imo the problem is that there is no OnClientExit script
I have hitpoints tracking in there and OnEnter and it works absolutelly correctly, if you logged out with 10hps you will log in with 10hps. If you died then you log in dead.
So in his module the HP tracking must be done probably in heatbeart or dont know, very possibly this value isnt reseted when player respawn/get resurrected.
Could you then post your module OnHeartbeat script?