Aller au contenu

On level up send message to dm?


  • Veuillez vous connecter pour répondre
4 réponses à ce sujet

#1
Guest_NWN Dragon-Blade_*

Guest_NWN Dragon-Blade_*
  • Guests
 Is there a way to script that on level up the DM gets a message saying who leveled up and to what level? 

#2
Melkior_King

Melkior_King
  • Members
  • 135 messages
The way to do that would be to make or customise the OnPlayerLevelup module script and send a message to the DM chat channel. Of course, the message would go nowhere if there are no DMs in the game at the time.
It would be possible to record the information in the game's log file if it's needed even if a DM isn't logged in.
I can't do any scripts right now due to just having an operation, or I'd help. If nobody can help you after I've recovered, I'll see what I can do.

#3
PurpleProse

PurpleProse
  • Members
  • 23 messages
Just add in the onlevelup handler:

object oLoop = GetFirstPC();
while (GetIsObjectValid(oLoop)){
if(GetIsDM(oLoop)) SendMessageToPC(oLoop, GetName(oPC) + " has leveled up to level " + GetHitDie(oPC));
oLoop = GetNextPC();
}

#4
GhostOfGod

GhostOfGod
  • Members
  • 863 messages
Don't really need a loop for anything. Just do something like this in the OnPlayerLevelUp event:


void main()
{
    object oPC = GetPCLevellingUp();
    string sLevel = IntToString(GetHitDice(oPC));
    string sMessage = GetName(oPC) + " has leveled up to level " + sLevel;
    SendMessageToAllDMs(sMessage);
}


Good luck.

Modifié par GhostOfGod, 16 mars 2011 - 05:20 .


#5
Guest_NWN Dragon-Blade_*

Guest_NWN Dragon-Blade_*
  • Guests
Ahh thankyou!