Is there a way to script that on level up the DM gets a message saying who leveled up and to what level?
On level up send message to dm?
Débuté par
Guest_NWN Dragon-Blade_*
, mars 16 2011 01:18
#1
Guest_NWN Dragon-Blade_*
Posté 16 mars 2011 - 01:18
Guest_NWN Dragon-Blade_*
#2
Posté 16 mars 2011 - 02:48
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.
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
Posté 16 mars 2011 - 04:36
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();
}
object oLoop = GetFirstPC();
while (GetIsObjectValid(oLoop)){
if(GetIsDM(oLoop)) SendMessageToPC(oLoop, GetName(oPC) + " has leveled up to level " + GetHitDie(oPC));
oLoop = GetNextPC();
}
#4
Posté 16 mars 2011 - 05:18
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.
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_*
Posté 16 mars 2011 - 11:37
Guest_NWN Dragon-Blade_*
Ahh thankyou!





Retour en haut






