This is a script for a DM wand .It teleports oPC to a waypoint in the jail.
Problem:
1. The message is not sending ..it supposed to send to all players ..
2. Not in the script yet ..but I would also like it to place prison outfit on the character also so it is not removable so if they login after reset it will put them back in jail..I know I will need an oclient enter script to check for this clothing also.
All help is appreciated
void MessageAll(string sMessage)
{
object oPlayer = GetFirstPC();
while(GetIsObjectValid(oPlayer))
{
SendMessageToPC(oPlayer,sMessage);
oPlayer = GetNextPC();
}
}
#include "x2_inc_switches"
void main()
{
int nEvent = GetUserDefinedItemEventNumber();
if(nEvent != X2_ITEM_EVENT_ACTIVATE) return;
object oUser = GetItemActivator();
if (!GetIsDM(oUser)) return;
object oPlayer = GetItemActivatedTarget();
object oWaypoint = GetWaypointByTag("jail1");
if (GetIsPC(oPlayer))
DelayCommand(5.0, AssignCommand(oPlayer, JumpToObject(oWaypoint)));
return;
object oPC = GetItemActivatedTarget();
string oPCname = GetName(oPC);
MessageAll( "<cÖ2¦>Jail:</c>" + GetName(oPC) + "<cÖ2¦>has been sent to jail for crimes against the land !</c> ");
}